astviewer
May 31, 2026 ยท View on GitHub
Graphical User Interface for viewing Python Abstract Syntax Trees.

Installation:
To install Astviewer use pip:
%> pip install astviewer
It should automatically install PyQt5 as well.
Usage:
Command line example:
%> astviewer myprog.py
Examples to use from within Python:
>>> from astviewer.main import view
>>> view(file_name='myprog.py')
>>> view(source_code = 'a + 3', mode='eval')
Further links:
The Green Tree Snakes documentation on ASTs is available for those who find the Python ast module documentation too brief.