GlassCode
Glasscode offers a window on classes and their attributes/functions on Python source code, making it more transparant. Hence the name.
GlassCode is a terminal-first Python project explorer that turns a codebase into a browsable class diagram. It statically analyzes a project using Python's AST, resolves class relationships, and presents them in a TUI so you can inspect inheritance, composition, and dependency links without leaving the terminal.
What it does
GlassCode scans a Python project directory, finds classes, and builds a lightweight model of:
- inheritance relationships (
extends/base classes) - composition links (attributes annotated or assigned with other types)
- dependency usage inside method signatures and annotations
- source locations for each class so you can jump directly to the implementation
The result is a navigable, filterable class browser suitable for mentally mapping a codebase before editing it.
Features
- AST-based static analysis of Python source files
- recursive project scanning with common virtual-environment and build folders excluded
- class tree grouped by module
- class diagram view with inheritance and relation summaries
- linked-class panel for quick navigation between related classes
- source view showing the original code for the selected class
- mouse-draggable dividers to adjust column widths
- keyboard-driven filtering and navigation in the terminal
Installation
With uv:
uv sync
Or install the package in editable mode with pip:
python -m pip install -e .
Usage
Run GlassCode against a Python project root:
glasscode /path/to/project
For example, from this repository:
uv run glasscode src
Keyboard shortcuts
q— quitBackspaceorb— go back to the previous class/— focus the class filtert— focus the class treel— focus the linked classes panels— focus the source view
Drag either vertical divider with the left mouse button to resize its neighboring columns. The chosen proportions are kept when the terminal is resized.
How it works
The project is split into two main pieces:
src/glasscode/analyzer.py— parses Python files withast, collects class metadata, resolves imports, and infers relations.src/glasscode/app.py— renders the Textual interface and lets you browse the diagram, related classes, and source code.
The analyzer intentionally focuses on a static, conservative view of the code: it gathers class definitions, resolves dotted names and imports, and infers likely object relationships from type annotations and assignments.
Example workflow
- Point GlassCode at a project root.
- Filter the class list to the area you care about.
- Select a class in the tree.
- Inspect its parent classes, downstream subclasses, composed types, and the source definition.
- Use the link panel to jump between connected classes and understand the object graph.
Notes
This tool is designed for quick codebase orientation rather than full semantic verification. It is intentionally lightweight and terminal-first, making it useful for scanning architecture and understanding relationships in a Python project before deeper review.
Metadata
Release files for glasscode 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| glasscode-1.1.0.tar.gz | 23.7 kB | Without provenance | Details for glasscode-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| glasscode-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for glasscode-1.1.0-py3-none-any.whl |
Total release size: 47.4 kB
Release files / glasscode-1.1.0.tar.gz
| Download URL | glasscode-1.1.0.tar.gz |
|---|---|
| Size | 23.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee83a68006e388fac27a4248a05feeee40458d9e5984fd37fd46c8468a950943
|
|
BLAKE2b-256 checksum How to use checksums |
6e499eedabc66fe1b4a036cc084d1a31b6cfbf13d6fee05c559fe7e7bae408ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Release files / glasscode-1.1.0-py3-none-any.whl
| Download URL | glasscode-1.1.0-py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b8b69e737f12e420ed66a4c3d793a51c3c070c3af017dfcbc2d27de297866ac
|
|
BLAKE2b-256 checksum How to use checksums |
4c8610f57c2c8d13228f51b5746a50d27a619415a212d3ae4b07d2c469dd65ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Security for glasscode 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.