A consistent AST for Python
Synr is a library that provides a stable Abstract Syntax Tree for Python.
import synr
def test_program(x: int):
return x + 2
# Parse a Python function into an AST
ast = synr.to_ast(test_program, synr.PrinterDiagnosticContext())
Please see https://synr.readthedocs.io/en/latest/ for documentation.