textual-astview
TUI tool for exploring Python Abstract Syntax Trees (AST) with interactive tree view and source highlighting
textual-astview is a terminal-based tool for exploring Python Abstract Syntax Trees (AST), built using the Textual framework. The tool provides an interactive tree view that displays the AST structure of Python source files alongside the corresponding source code with syntax highlighting.
The tool consists of both a command-line application called astare and a library of Textual widgets. The main widgets include ASTView for displaying the AST tree structure, Source for showing syntax-highlighted source code, and NodeInfo for displaying summary information about the currently focused AST node. These widgets work together to provide synchronized navigation between the AST tree and source code.
The application supports features like dark/light mode toggling, resizable panes, file loading without restarting, and configurable source code styling using Pygments themes. Users can navigate through the AST structure and see corresponding source code sections highlighted, making it useful for developers learning about Python's internal representation or debugging code analysis tools.
Note that the author has marked this repository as unlikely to receive future updates, recommending the newer DHV application instead. The tool requires Python and can be installed via pip, making it accessible to Python developers interested in understanding AST structures or building code analysis tools.
Installation
# via pip
pip install textual_astview

Alternatives & related tools
peplum
Terminal-based browser and search interface for Python Enhancement Proposals (PEPs)
Azure CLI
Microsoft's cross-platform command-line interface for managing Azure resources with az group/subgroup/command syntax, JMESPath queries, and tab completion.
harlequin
Terminal-based SQL IDE with database adapter support for DuckDB, SQLite, PostgreSQL, MySQL and dozens of other databases
GDB dashboard
A standalone .gdbinit written in Python that shows a modular dashboard of program state in GDB each time the debugged program stops.
AWS CLI
Official command line interface for Amazon Web Services, with profile-based credentials, configurable output, and shell tab completion.
add a badge to your README
Maintain textual-astview? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/textual-astview?utm_source=badge)<a href="https://www.trmn.sh/tools/textual-astview?utm_source=badge"><img src="https://www.trmn.sh/badge/textual-astview.svg" alt="Featured on trmn" height="20"></a>