astviewer

May 31, 2026 ยท View on GitHub

Graphical User Interface for viewing Python Abstract Syntax Trees.

astviewer screen shot

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')

The Green Tree Snakes documentation on ASTs is available for those who find the Python ast module documentation too brief.