pyright-analysis


Namepyright-analysis JSON
Version 1.0.0rc3 PyPI version JSON
download
home_pageNone
SummaryVisualise Python project type completeness
upload_time2025-01-01 16:07:09
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseNone
keywords pyright type-compleness visualisation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Generate a treemap graph from Pyright verifytypes output.

[![PyPI version](https://img.shields.io/pypi/v/pyright-analysis.svg)](https://pypi.python.org/project/pyright-analysis)
[![License](https://img.shields.io/pypi/l/pyright-analysis.svg)](https://pypi.python.org/pypi/ruff)
![Python versions supported](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fmjpieters%2Fpyright-analysis%2Fmain%2Fpyproject.toml)
[![Built with uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![Checked with Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Checked with Pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
[![Python checks](https://github.com/mjpieters/pyright-analysis/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/mjpieters/pyright-analysis/actions/workflows/ci-cd.yml)
[![Coverage](https://codecov.io/gh/mjpieters/pyright-analysis/graph/badge.svg?token=ZRZO4XRBP6)](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):

![Sample graph output for prefect](https://raw.githubusercontent.com/mjpieters/pyright-analysis/refs/heads/main/assets/graph-screenshot.png)  <!-- 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:

![pyright-analysis help output](https://raw.githubusercontent.com/mjpieters/pyright-analysis/refs/heads/main/assets/cmd-help.png)  <!-- 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[![PyPI version](https://img.shields.io/pypi/v/pyright-analysis.svg)](https://pypi.python.org/project/pyright-analysis)\n[![License](https://img.shields.io/pypi/l/pyright-analysis.svg)](https://pypi.python.org/pypi/ruff)\n![Python versions supported](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fmjpieters%2Fpyright-analysis%2Fmain%2Fpyproject.toml)\n[![Built with uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)\n[![Checked with Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Checked with Pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)\n[![Python checks](https://github.com/mjpieters/pyright-analysis/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/mjpieters/pyright-analysis/actions/workflows/ci-cd.yml)\n[![Coverage](https://codecov.io/gh/mjpieters/pyright-analysis/graph/badge.svg?token=ZRZO4XRBP6)](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![Sample graph output for prefect](https://raw.githubusercontent.com/mjpieters/pyright-analysis/refs/heads/main/assets/graph-screenshot.png)  <!-- 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![pyright-analysis help output](https://raw.githubusercontent.com/mjpieters/pyright-analysis/refs/heads/main/assets/cmd-help.png)  <!-- 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"
}
        
Elapsed time: 0.58005s