PythonNet
grammars-v4
Our great sponsors
PythonNet | grammars-v4 | |
---|---|---|
37 | 29 | |
4,306 | 9,721 | |
2.2% | 1.5% | |
7.2 | 9.6 | |
7 days ago | about 5 hours ago | |
C# | ANTLR | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
PythonNet
- I modified and hacked away xonsh source code
-
[WPF, C#] Need ideas on how to automate these operations based on the response I get from python script.
If you're running the python within C# using Python.NET, then you're somewhat within-process and there are ways of sending the data across. (Return objects, channel/queues, whatever fits your use case.)
-
Starting Python, confused about cross platform app development. Is IronPython + .NET the only option?
I am not set on .NET, but just curious, so thanks for the suggestions. Interesting that it's billed as cross-plaform, but doesn't do it that well. I just searched 'python wrapper for .net' and found PythonNET. Also, it seems yes IronPython is active.
There's other modules that provide the interface to .NET. The pywin32 module is very popular to allow access to the complete Windows API. Or try Pythonnet.
-
TIA Openness with Docker
I created a Django based python project that interfaces to TIA Openness to create some Remote IO. To do this I use the pythonnet library. so that I can load the Openness DLL.
-
Python's “Disappointing” Superpowers
Any .NET language with https://github.com/pythonnet/pythonnet
-
A Simple Union Between .NET Core and Python
We’re going to be looking at Python for .NET in order to accomplish this goal. This library allows you to take advantage of Python installed on the running machine from within your .NET Core applications. You must configure it to point at the corresponding Python DLL that you’d like to use, and after a couple of lines of initialization you’re off to the races!
- CLI Scraper
-
.NET-compatible scripting languages for users to write their own scripts to query/manipulate objects/properties in the app
There is also PythonNET which is a wrapper around the actual C based Python implementation (python.org). I don't know about a sandboxing capability though.
-
Create CPython extensions in .NET?
Maybe PythonNET can do what you need? http://pythonnet.github.io. My use case was embedding a Python engine into my app, but I believe you could use it to create a "module" for Python. I would recommend writing a wrapper that does the import clr and so forth automatically though, so the user doesn't have to do that themselves.
grammars-v4
- Operadores de adição e subtração
-
Postgres Language Server: Implementing the Parser
Where is the SQLite test suite, please? I'd be very interested.
There are already SQL grammars, check https://github.com/antlr/grammars-v4 specifically in here I think https://github.com/antlr/grammars-v4/tree/master/sql I contributed to one of them, and I wrote my own for some personal work. Be warned, it's very involved, very complex and MSSQL is rather ill-defined.
Names bracket identifiers) in SQL are bloody awful. Sometimes square brackets are even compulsory, and why you can usually replace [...] with the SQL standard "..." , not always! Trust me, it gets worse.
I don't find antlr grammars to be brittle, and while they can lose in performance (by how much I don't know, perhaps quite considerably) they are very easy to maintain and I am very fortunate to have antlr to work with.
-
Llama: Add Grammar-Based Sampling
This grammar "library" was cited as an example of what the format could look like:.
https://github.com/antlr/grammars-v4
There is everything from assembly and C++ to glsl and scripting languages, arithmetic, games, and other weird formats.
-
Structured Output from LLMs (Without Reprompting!)
> Which brings me to the other approach: steering the LLM's output __as it is generating tokens__
A relevant PR:
https://github.com/ggerganov/llama.cpp/pull/1773
The plan is to support arbitrary grammar files to constrain tokens as they are generated, like the ones here:
-
SQL-Parsing
Have a look at jooq - I know this has been used to rewrite SQL from one dialect to another, so it MUST be capable of collating code activity metrics. Look here. Otherwise, you might want to look into writing your own parser. ANTLR has a T-SQL dialect parser script here.
-
How should I prepare for AI-driven changes in the industry as a Software Engineering Manager
Find a Perl grammar file for ANTLR, like https://github.com/antlr/grammars-v4/tree/master/perl Save the grammar file as Perl.g4 in your project. Now, you can create the Kotlin program: import org.antlr.v4.runtime.* import org.antlr.v4.runtime.tree.ParseTree import java.io.File
-
DELD: An experimental HTTP-Client
Antlr is another option. You could generate a parser using the JSON antlr grammar.
- lang.g4: ANTLR4 Grammar for different programming languages
-
SQLite Internals: How the Most Used Database Works
> ...than it would be to learn the exact syntax and quirks and possibly bugs of someone else's implementation...
Yup. Also, having deep knowledge of the language is required.
SQLite's grammar is neat. Creating a compatible parser would make a fun project. Here's a pretty good example: https://github.com/bkiers/sqlite-parser (Actual ANTLR 4 grammar: https://github.com/bkiers/sqlite-parser/blob/master/src/main... )
Postgres, which tries to be compliant with the latest standards, however...
SQL-2016 is a beast. Not to mention all the dialects.
I'm updating my personal (soon to be FOSS) grammar from ANTLR 3 LL(k) to ANTLR 4 ALL().
I've long had a working knowledge of SQL-92, with some SQL-1999 (eg common table expressions).
But the new structures and extensions are a bit overwhelming.
Fortunately, ANTLR project has ~dozen FOSS grammars to learn from. https://github.com/antlr/grammars-v4/tree/master/sql
They mostly mechanically translate BNFs to LL(k) with some ALL(). Meaning few take advantage of left-recursion. https://github.com/antlr/antlr4/blob/master/doc/left-recursi...
Honestly, I struggled to understand these grammars. Plus, not being conversant with the SQL-2016 was a huge impediment. Just finding a succinct corbis of test cases was a huge hurdle for me.
Fortunately, the H2 Database project is a great resource. https://github.com/h2database/h2database/tree/master/h2/src/...
Now for the exciting conclusion...
My ANTLR grammar which passes all of H2's tests looks nothing like any of the official or product specific BNFs.
Further, I found discrepancy between the product specific BNFs and their implementations.
So a lot of trial & error is required for a "real world" parser. Which would explain why the professional SQL parsing tools charge money.
I still think creating a parser for SQLite is a great project.
-
.NET-compatible scripting languages for users to write their own scripts to query/manipulate objects/properties in the app
You can find C# grammar files already defined online: https://github.com/antlr/grammars-v4/tree/master/csharp
What are some alternatives?
Iron python - Implementation of the Python programming language for .NET Framework; built on top of the Dynamic Language Runtime (DLR).
PyWin32 - python for windows extensions
WinPython - A free Python-distribution for Windows platform, including prebuilt packages for Scientific Python.
CefSharp - .NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
CppSharp - Tools and libraries to glue C/C++ APIs to high-level languages
NuGetForUnity - A NuGet Package Manager for Unity
pyxll-utils
pinvoke - A library containing all P/Invoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.
LegacyWrapper - LegacyWrapper uses a x86 wrapper to call legacy dlls from a 64 bit process (or vice versa).
pythonlibs - A Python wrapper for the extremely fast Blosc compression library
ANTLR - ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
python-language-server - Microsoft Language Server for Python