Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running in python #28

Open
hildogjr opened this issue Sep 23, 2019 · 3 comments
Open

Running in python #28

hildogjr opened this issue Sep 23, 2019 · 3 comments

Comments

@hildogjr
Copy link

Is v2 already in point of test?
I want to run it in Python to integrate in other tool. Should be interesting be available on PyPI.

Also, as a KiCad user. I believe could it be interesting have a way to parse the footprint names provided by KiCad and extract the really package name.

@kasbah
Copy link
Member

kasbah commented Feb 17, 2020

Just to leave a note here (we were previously discussing this somewhere else when you opened this issue I think). Work on a Python version has stalled. I still think it's a great idea but yeah, no one is working on it at the moment.

@set-soft
Copy link

Hi @kasbah and @hildogjr !

  • I made a port to Lark, the lark grammar can be found here.
  • The class to convert the parsed tree into a dict compatible with the JavaScript is here.
  • I also added some basic inductor parsing.
  • The code is passing all the tests I found in the JS version, but I didn't implement the CPL stuff.
  • A very important difference is that I'm not relying on catching parser errors, retry and keep the last match. I incorporated the flexibility of unknown stuff (which I call crap) in the grammar itself, after all Early algorithm can handle ambiguity. The crap is collected and you can check what was discarded. A drawback: is really slow.
  • I also tried to port the ne files to Lark. It can read Nearly files and generate a Python code that emulates the JS. It took some work because it only supports JS 5 and not 6. But I discarded this approach because it pulls various dependencies.
  • I kept the MIT license just in case @kasbah is interested in adding it to this project.
  • Note that Lark is pure Python without any extra dependency, has a Debian package, and is usually installed in desktop systems.

@kasbah
Copy link
Member

kasbah commented Mar 31, 2023

Very nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants