https://github.com/salt-die/prettiest_ast
A pretty printer for python abstract syntax trees.
https://github.com/salt-die/prettiest_ast
abstract-syntax-tree pretty-printer syntax-trees
Last synced: 4 months ago
JSON representation
A pretty printer for python abstract syntax trees.
- Host: GitHub
- URL: https://github.com/salt-die/prettiest_ast
- Owner: salt-die
- License: mit
- Created: 2020-07-27T06:44:47.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-09T00:23:55.000Z (over 4 years ago)
- Last Synced: 2025-12-16T19:57:58.067Z (6 months ago)
- Topics: abstract-syntax-tree, pretty-printer, syntax-trees
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prettiest_ast
A simple pretty printer for python abstract syntax trees:
```py
>>> from prettiest_ast import ppast
>>> ppast('for i in range(5): print(i)')
For
├──Name
│ ├──i
│ ╰──Store
├──Call
│ ├──Name
│ │ ├──range
│ │ ╰──Load
│ ╰──Constant
│ ╰──5
╰──Expr
╰──Call
├──Name
│ ├──print
│ ╰──Load
╰──Name
├──i
╰──Load
```