nimastparser
Python Library to parse and unparse nim code into ast tree .
Getting started
Install
pip install nimastparser
Usage :
Note : nim Compiler must be installed on your machine .
from nimastparser import nim
code = '''
let value = 2
case value
of 1:
echo "Value is one"
of 2:
echo "Value is two"
of 3, 4:
echo "Value is three or four"
else:
echo "Value is something else"
'''
# nim = None , get nim path from system using whcih nim
# otherwise nim = path/to/nim
tree = nim.parse(code=code , nim = None )
print(f"Ast Tree :\n{tree}")
# nim = None , get nim path from system using whcih nim
# otherwise nim = path/to/nim
generated_code = nim.unparse(code=tree , nim = None )
print(f"Converted code from Tree :\n{generated_codetree}")
Metadata
Release files for nimastpaser 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nimastpaser-1.0.1.tar.gz | 3.0 kB | Without provenance | Details for nimastpaser-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nimastpaser-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for nimastpaser-1.0.1-py3-none-any.whl |
Total release size: 5.3 kB
Release files / nimastpaser-1.0.1.tar.gz
| Download URL | nimastpaser-1.0.1.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1155e258439ec4fb3b3dc6adc182a295f0a6f2f1d18b9a77a099f8e3cf1e3634
|
|
BLAKE2b-256 checksum How to use checksums |
87f9b4bf866af1b582f7f312911a3b2a75996b42245657dac8cd8fdb54b67da0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / nimastpaser-1.0.1-py3-none-any.whl
| Download URL | nimastpaser-1.0.1-py3-none-any.whl |
|---|---|
| Size | 2.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2b9f79a94ea019222cd8c373c96a6e30786328a5c77db8070552c44fa68c4dd
|
|
BLAKE2b-256 checksum How to use checksums |
f80c334a60e5408e7020a82852f83d2ed16d2ca01644043fe830a8e3b04fda82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for nimastpaser 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.