# Generate a treemap graph from Pyright verifytypes output.
[](https://pypi.python.org/project/pyright-analysis)
[](https://pypi.python.org/pypi/ruff)

[](https://github.com/astral-sh/uv)
[](https://github.com/astral-sh/ruff)
[](https://microsoft.github.io/pyright/)
[](https://github.com/mjpieters/pyright-analysis/actions/workflows/ci-cd.yml)
[](https://codecov.io/gh/mjpieters/pyright-analysis)
A simple cli tool to visualise the state of a Python project's _type completeness_, from the output of pyright's [`--outputjson --verifytypes` command](https://microsoft.github.io/pyright/#/typed-libraries?id=verifying-type-completeness):
 <!-- 1980 × 1352 screenshot from Firefox, wrapped with https://shoteasy.fun/screenshot-beautifier/ to 4x3 ratio (2400 × 1800) -->
The interactive graph depicts a projects modules as a tree, with each the size of each module based on the number of exported symbols.
## Usage
Use a Python tool manager like [`uv tool`](https://docs.astral.sh/uv/guides/tools/) or [`pipx`](https://pipx.pypa.io/):
```sh
$ 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:
```sh
$ 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:
 <!-- created with termshot --columns 100 --show-cmd -->
## Features
- 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.
## Development
This project uses [`uv`](https://docs.astral.sh/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](https://docs.astral.sh/ruff/) (used for linting and formatting) and [Pyright](https://microsoft.github.io/pyright/) (used to validate type annotations).
### Linting and formatting
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](https://pre-commit.com/) hooks that will run these tools and format your changes automatically on commits. These hooks also run `uv sync` whenever you working tree changes.
### Testing
This project uses `pytest` to run its tests: `uv run pytest`.
Raw data
{
"_id": null,
"home_page": null,
"name": "pyright-analysis",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "pyright, type-compleness, visualisation",
"author": null,
"author_email": "Martijn Pieters <mj@zopatista.com>",
"download_url": "https://files.pythonhosted.org/packages/b9/6e/1518a695d8b592a5791336789eabfea150f4341b8209768d8cb105223e50/pyright_analysis-1.0.0rc3.tar.gz",
"platform": null,
"description": "# Generate a treemap graph from Pyright verifytypes output.\n\n[](https://pypi.python.org/project/pyright-analysis)\n[](https://pypi.python.org/pypi/ruff)\n\n[](https://github.com/astral-sh/uv)\n[](https://github.com/astral-sh/ruff)\n[](https://microsoft.github.io/pyright/)\n[](https://github.com/mjpieters/pyright-analysis/actions/workflows/ci-cd.yml)\n[](https://codecov.io/gh/mjpieters/pyright-analysis)\n\nA simple cli tool to visualise the state of a Python project's _type completeness_, from the output of pyright's [`--outputjson --verifytypes` command](https://microsoft.github.io/pyright/#/typed-libraries?id=verifying-type-completeness):\n\n <!-- 1980 \u00d7 1352 screenshot from Firefox, wrapped with https://shoteasy.fun/screenshot-beautifier/ to 4x3 ratio (2400 \u00d7 1800) -->\n\nThe interactive graph depicts a projects modules as a tree, with each the size of each module based on the number of exported symbols.\n\n## Usage\n\nUse a Python tool manager like [`uv tool`](https://docs.astral.sh/uv/guides/tools/) or [`pipx`](https://pipx.pypa.io/):\n\n```sh\n$ uv tool install pyright\n$ uv tool install pyright-analysis\n```\n\nThen generate a type compleness JSON report for your package, and transform the report into a graph:\n\n```sh\n$ pyright --outputjson --ignoreexternal --verifytypes PACKAGE > PACKAGE.json\n$ pyright-analysis PACKAGE.json\n```\n\nThis will open the resulting graph in your browser.\n\nFull help documentation is available on the command-line:\n\n <!-- created with termshot --columns 100 --show-cmd -->\n\n## Features\n\n- Interactive responsive graph. Hover over each package to get more detail about symbol counts and completeness, or click on packages to zoom in.\n- Export options:\n - Full stand-alone HTML page.\n - HTML div snippet with configurable HTML id.\n - Static image export as PNG, JPG, WebP, SVG or PDF.\n - Plotly JSON graph representation.\n\n## Development\n\nThis project uses [`uv`](https://docs.astral.sh/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](https://docs.astral.sh/ruff/) (used for linting and formatting) and [Pyright](https://microsoft.github.io/pyright/) (used to validate type annotations).\n\n### Linting and formatting\n\nWhile 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](https://pre-commit.com/) hooks that will run these tools and format your changes automatically on commits. These hooks also run `uv sync` whenever you working tree changes.\n\n### Testing\n\nThis project uses `pytest` to run its tests: `uv run pytest`.\n",
"bugtrack_url": null,
"license": null,
"summary": "Visualise Python project type completeness",
"version": "1.0.0rc3",
"project_urls": {
"Changelog": "https://github.com/mjpieters/pyright-analysis/blob/master/CHANGELOG.md",
"GitHub": "https://github.com/mjpieters/pyright-analysis",
"Issues": "https://github.com/mjpieters/pyright-analysis/issues"
},
"split_keywords": [
"pyright",
" type-compleness",
" visualisation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0b5541c2b4538f9630ffd5ef88d39b9b4a4281d2fdd17c9a512d645d9d864ab5",
"md5": "273f923a9808b9813ad4845d0bd63393",
"sha256": "a3de71593c43e3602a2131340420bcc232b3b244dadbe791aa57e8b35b7909f6"
},
"downloads": -1,
"filename": "pyright_analysis-1.0.0rc3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "273f923a9808b9813ad4845d0bd63393",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 10253,
"upload_time": "2025-01-01T16:07:07",
"upload_time_iso_8601": "2025-01-01T16:07:07.373265Z",
"url": "https://files.pythonhosted.org/packages/0b/55/41c2b4538f9630ffd5ef88d39b9b4a4281d2fdd17c9a512d645d9d864ab5/pyright_analysis-1.0.0rc3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b96e1518a695d8b592a5791336789eabfea150f4341b8209768d8cb105223e50",
"md5": "36235afb930aae26619e98a9e3147983",
"sha256": "348d88f287023a0f520105b280d72a9a0a7349b609411803aa2e79198d3c44d4"
},
"downloads": -1,
"filename": "pyright_analysis-1.0.0rc3.tar.gz",
"has_sig": false,
"md5_digest": "36235afb930aae26619e98a9e3147983",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 8779,
"upload_time": "2025-01-01T16:07:09",
"upload_time_iso_8601": "2025-01-01T16:07:09.787662Z",
"url": "https://files.pythonhosted.org/packages/b9/6e/1518a695d8b592a5791336789eabfea150f4341b8209768d8cb105223e50/pyright_analysis-1.0.0rc3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-01 16:07:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mjpieters",
"github_project": "pyright-analysis",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyright-analysis"
}