A simple cli tool to visualise the state of a Python project's type completeness, from the output of pyright's --outputjson --verifytypes
command:
The interactive graph depicts a projects modules as a tree, with each the size of each module based on the number of exported symbols.
Use a Python tool manager like uv tool
or pipx
:
$ uv tool install pyright
$ uv tool install pyright-analysis
Then generate a type compleness JSON report for your package, and transform the report into a graph:
$ pyright --outputjson --ignoreexternal --verifytypes PACKAGE > PACKAGE.json
$ pyright-analysis PACKAGE.json
This will open the resulting graph in your browser.
Full help documentation is available on the command-line:
- Interactive responsive graph. Hover over each package to get more detail about symbol counts and completeness, or click on packages to zoom in.
- Export options:
- Full stand-alone HTML page.
- HTML div snippet with configurable HTML id.
- Static image export as PNG, JPG, WebP, SVG or PDF.
- Plotly JSON graph representation.
This project uses uv
to handle Python dependencies and environments; use uv sync
to get an up-to-date virtualenv with all dependencies. This includes development dependencies such as Ruff (used for linting and formatting) and Pyright (used to validate type annotations).
While PRs and commits on GitHub are checked for linting and formatting issues, it's easier to check for issues locally first. After running uv sync
, run uv run pre-commit install
to install pre-commit hooks that will run these tools and format your changes automatically on commits. These hooks also run uv sync
whenever you working tree changes.
This project uses pytest
to run its tests: uv run pytest
.