Skip to main content

typegun

Special Gun Special
—Super Smash Bros. Ultimate

Typegun is a small command-line utility for python to run a bunch of python typecheckers on a project, to see if there are any problems. This grew out of a script I would cart around, which I decided to make a reusable package.

(For the purposes of typegun, by typechecker I mean static analysis tools only; Not a "runtime type checker", of which there are many in Python. A "semi-static" typechecker like pyanalyze or pycroscope would be allowable here as a static analysis tool.)

This only includes typecheckers that have a reasonable shot at typing near-current-version python projects mostly-correctly, in my (non-scientific) opinion, a list which may vary over time. If you'd like to add more or bicker about the configurations these typecheckers should have, I'm happy to hear it. The versions of these typecheckers are completely unpinned, all the better to get the most recent versions of them probably. It also includes ruff, which is not a typechecker, but is very useful for code quality nonetheless.

Typegun is strategic about the order in which it runs its typecheckers, and this ordering is determined by the speed and utility of the typechecker. Ruff runs first because it runs very fast and never false-positives a type error at all, while still alerting you to other problems that may cause a type error, which the other typecheckers will detect more slowly later. Pyright runs second because it's fast and very correct to the python typing spec. Mypy runs after this because it's slower and has a couple typing problems. pytype runs last because it is slow and doesn't fully support Python 3.12 yet.

Example usage

In your project directory, do one of the following, depending on what you have installed already:

typegun

uvx typegun

pipx run typegun

pip install typegun --break-system-packages && typegun

etc etc

Illustrative diagram

poorly-drawn cartoon image of a man firing a shotgun (the bullets of which have been labeled "mypy", "pyright", etc) at a python project

Release files for typegun 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for typegun 1.0.1
File Size Uploaded
typegun-1.0.1.tar.gz 89.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for typegun 1.0.1
File Interpreter ABI Platform
typegun-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 95.3 kB

Release files / typegun-1.0.1.tar.gz

Download URL typegun-1.0.1.tar.gz
Size 89.2 kB
Tags Source
SHA-256 checksum
How to use checksums
101a47efbc5c76e7f204a20a769c096b1f2963890f676fe171ec6a46e6beee64
BLAKE2b-256 checksum
How to use checksums
53e1152c8ba4b6417a223447def5b0efb539f32a8e4d6cf9490af71badd23a97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Release files / typegun-1.0.1-py3-none-any.whl

Download URL typegun-1.0.1-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb41ea95e813708ca8c6e70e1162e9ae41ae78e2ef5d7d0c48e47f9fdfd23d5b
BLAKE2b-256 checksum
How to use checksums
6221126f92fe7fdbf51c622ea0b502c13f9dc87af8f2e37409afe28c7e96f71c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page