Parse Python source code and return an AST.
The Python source code to parse
Optional
The filename (optional, defaults to '')
The parsed module's AST
If source contains a syntax error
source
import { parseModule } from "py-ast";const tree = parseModule("def f(): pass", "example.py"); Copy
import { parseModule } from "py-ast";const tree = parseModule("def f(): pass", "example.py");
Parse Python source code and return an AST.