A minimal python parser, written in python
$ pip install -e minipyparser
$ pip install minipyparser
# examples/hello_world.py
print("hello, from mars!")
# examples/main.py
from minipyparser import tokenizer
from minipyparser import parser
for ast in parser.parse(tokenizer.tokenize(open("hello_world.py"))):
print(ast)
$ cd examples
$ python main.py
Comment(value='examples/hello_world.py')
Call(head=Name(print), args=[Literal(value='hello, from mars!')])
2022 - Marcel Guinhos