awesome-python-typing

Type checker

A collection of tools and libraries for Python type checking and static analysis.

Collection of awesome Python types, stubs, plugins, and tools to work with them.

GitHub

2k stars
48 watching
69 forks
last commit: about 2 years ago
Linked from 4 awesome lists

awesomeawesome-listmypymypy-pluginsmypy-stubspep484pyipythonpython-stubspython-types

Awesome Python Typing / Static type checkers

basedmypy148almost 2 years agoBased static typing with baseline functionality
basedpyright1,300almost 2 years agoPyright fork with improvements to VSCode support and various other fixes
mypy18,687almost 2 years agoOptional static typing (PEP 484)
pyanalyze350almost 2 years agoExtensible static analyzer and type checker
pycharmIDE for Professional Developers
pylyzer2,550almost 2 years agoA fast static code analyzer & language server for Python, written in Rust
pyrePerformant type-checker
pyright13,573almost 2 years agoFast type checker meant for large Python source bases. It can run in a “watch” mode and performs fast incremental updates when files are modified
pytype4,791almost 2 years agoTool to check and infer types - without requiring type annotations

Awesome Python Typing / Dynamic type checkers

beartype2,782almost 2 years agoUnbearably fast runtime type-checking in pure Python
pydantic21,677almost 2 years agoData parsing using Python type hinting. Supports dataclasses
pytypes201over 3 years agoProvides a rich set of utilities for runtime typechecking
strongtyping111almost 2 years agoDecorator which checks whether the function is called with the correct type of parameters
typedpy16about 2 years agoType-safe, strict Python. Works well with standard Python
typeguard1,569almost 2 years agoAnother one runtime type checker
typical182about 2 years agoData parsing and automatic type-coercion using type hinting. Supports dataclasses, standard classes, function signatures, and more
trycast79about 2 years agoParse JSON-like values whose shape is defined by typed dictionaries (TypedDicts) and other standard Python type hints

Awesome Python Typing / Stub packages

asgiref1,495almost 2 years agoASGI specification, provides module with type annotations for ASGI servers
boto3-stubsStubs for
botostubs95over 3 years agoGives you code assistance for any boto3 API in any IDE
celery-types87almost 2 years agoType stubs for and its related packages , , , , and
django-stubs1,630almost 2 years agoStubs for
djangorestframework-stubs458almost 2 years agoStubs for
grpc-stubs37over 2 years agoStubs for
lxml-stubs45over 2 years agoStubs for
PyQt5-stubs68about 3 years agoStubs for
python-phonenumbers-stubs2about 5 years agoStubs for
pythonista-stubs13about 2 years agoStubs for
scipy-stubs23almost 2 years agoStubs for
sqlalchemy-stubs571over 2 years agoStubs for
sqlalchemy2-stubsOfficial stubs and mypy plugin for
torchtyping1,408about 2 years agoEnhanced type annotations for
types-aiobotocoreStubs for
typeshed4,419almost 2 years agoCollection of library stubs, with static types

Awesome Python Typing / Additional types

meiga76almost 2 years agoSimple, typed and monad-based Result type
option85over 2 years agoRust like Option and Result types
optype24almost 2 years agoOpinionated and alternative: Flexible single-method protocols and typed operators with predictable names
phantom-types205almost 2 years agoPhantom types
returns3,687almost 2 years agoMake your functions return something meaningful, typed, and safe
safetywrap44about 6 years agoFully typesafe, Rust-like Result and Option types
typet22almost 7 years agoLength-bounded types, dynamic object validation
useful-types115almost 2 years agoCollection of useful protocols and type aliases

Awesome Python Typing / Backports and improvements

future-typing19over 5 years agoBackport for type hinting generics in standard collections and union types as
typing-extensions450almost 2 years agoBackported and experimental type hints
typing-utils12almost 4 years agoBackport 3.8+ runtime typing utils(for eg: get_origin) & add issubtype & more

Awesome Python Typing / Tools / Linters

flake8-annotations-complexity46over 3 years agoPlugin for flake8 to validate annotations complexity
flake8-annotations156almost 2 years agoPlugin for flake8 to check for presence of type annotations in function definitions
flake8-pyi73almost 2 years agoPlugin for Flake8 that provides specializations for type hinting stub files
flake8-type-checking115almost 2 years agoPlugin to help you guard any type-annotation-only import correctly
flake8-typing-imports48almost 2 years agoPlugin which checks that typing imports are properly guarded
flake8-typing-only-imports115almost 2 years agoflake8 plugin that helps identify which imports to put into type-checking blocks, and how to adjust your type annotations once imports are moved
flake8-type-ignoreflake8 plugin to disallow type: ignore comments in your typed Python code
wemake-python-styleguide2,574almost 2 years agoThe strictest and most opinionated Python linter ever
Ruff33,816almost 2 years agoExtremely fast linter which supports lint rules from many other lint tools, such as flake8

Awesome Python Typing / Tools / Testing

mypy-test5almost 3 years agoTest mypy plugins, stubs, custom types
pytest-mypy-plugins107about 2 years agoPytest plugin for testing mypy types, stubs, and plugins
pytest-mypy-testing31over 2 years agoPytest plugin to test mypy static type analysis
pytest-mypy249almost 2 years agoMypy static type checker plugin for Pytest

Awesome Python Typing / Tools / Working with types

com2ann142over 2 years agoTool for translation of type comments to type annotations
merge-pyi4,791almost 2 years agoPart of pytype toolchain, applies stub files onto source code
mypy-baseline59almost 2 years agoIntegrate mypy with existing codebase. A CLI tool that filters out existing type errors and reports only new ones
mypy-protobuf659almost 2 years agoTool to generate mypy stubs from protobufs
mypy-silent14almost 2 years agoSilence mypy by adding or removing code comments
mypyc18,687almost 2 years agoCompiles mypy-annotated, statically typed Python modules into CPython C extensions
retype141about 4 years agoAnother tool to apply stubs to code
typeforce19almost 4 years agoCLI tool that enriches your Python environment with type annotations, empowering mypy
typesplainer82about 3 years agoA Python type explainer
typing-inspect352about 2 years agoThe typing_inspect module defines experimental API for runtime inspection of types defined in the module
typing-jsonLib for working with typed objects and JSON

Awesome Python Typing / Tools / Helper tools to add annotations to existing code

autotyping241about 2 years agoAutomatically add simple return type annotations for functions (bool, None, Optional)
infer-types86over 3 years agoCLI tool to automatically infer and add type annotations into Python code
jsonschema-gentypes41almost 2 years agoGenerate Python types based on TypedDict from a JSON Schema
monkeytype4,797about 2 years agoCollects runtime types of function arguments and return values, and can automatically generate stub files or even add draft type annotations directly to your code based on the types collected at runtime
no_implicit_optional85almost 3 years agoA codemod to make your implicit optional type hints compliant
pyannotate1,428about 4 years agoInsert annotations into your source code based on call arguments and return types observed at runtime
PyTypes11about 4 years agoInfer Types by Python Tracing
pyre infer6,885almost 2 years agoPyre has a powerful feature for migrating codebases to a typed format. The command-line option ingests a file or directory, makes educated guesses about the types used, and applies the annotations to the files
pytest-annotate109over 4 years agoPyannotate plugin for pytest
pytest-monkeytype43about 6 years agoMonkeyType plugin for pytest
pytype annotate-ast4,791almost 2 years agoA work-in-progress tool to annotate the nodes of an AST with their Python types
type4py62about 3 years agoDeep Similarity Learning-Based Type Inference
typilus59over 3 years agoA deep learning algorithm for predicting types in Python. Also available as a
auto-optional17almost 4 years agoMakes typed arguments Optional when the default argument is

Awesome Python Typing / Tools / Mypy plugins

kubernetes-typed21about 2 years agoPlugin for kubernetes type checking
loguru-mypy20over 2 years agoPlugin for support
mypy-zope39almost 2 years agoPlugin for support
mypy/plugins18,687almost 2 years agoPlugins already integrated into mypy
numpyPlugin for support
pynamodb-mypy4almost 4 years agoPlugin for support

Awesome Python Typing / Integrations

emacs-flycheck-mypy38over 6 years agoMypy integration for Emacs
mypy-playground72almost 2 years agoOnline playground for mypy
mypy-pycharm-plugin314over 5 years agoMypy integration for PyCharm
pylance1,726almost 2 years agoPyRight integration for VSCode
vim-mypy97almost 7 years agoMypy integration for Vim
nbQA1,057almost 2 years agoRun type checkers (e.g. Mypy) on Jupyter Notebooks

Awesome Python Typing / Articles / PEPs

PEP-3107Function Annotations
PEP-482Literature Overview for Type Hints
PEP-483The Theory of Type Hints
PEP-484Type Hints
PEP-526Syntax for Variable Annotations
PEP-544Protocols: Structural subtyping (static duck typing)
PEP-557Data Classes
PEP-560Core support for typing module and generic types
PEP-561Distributing and Packaging Type Information
PEP-563Postponed Evaluation of Annotations
PEP-585Type Hinting Generics In Standard Collections
PEP-586Literal Types
PEP-589TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys
PEP-591Adding a final qualifier to typing
PEP-593Flexible function and variable annotations
PEP-604Complementary syntax for Union[]
PEP-612Parameter Specification Variables
PEP-613Explicit Type Aliases

Awesome Python Typing / Articles / Third-party articles

1-minute guide to real constants in PythonFull tutorial about constants and inheritance
Simple dependent types in PythonFull tutorial about types
Testing mypy stubs, plugins, and typesFull tutorial about testing mypy types
Our journey to type checking 4 million lines of PythonDropbox has been one of the first companies to adopt Python static type checking at this scale
PyTest MonkeyType IntroductionType Annotate an existing Python Django Codebase with MonkeyType
The state of type hints in PythonAs of May 2018
Type hints cheat sheetCheat sheet on writing type annotations by MyPy team
Typechecking Django and DRFFull tutorial about type-checking django
Type Check Your Django ApplicationAn article based on two recent talks on adding type checks to Django
typingOfficial Python documentation for module
Python-typing-koans119almost 5 years agoA set of examples to learn optional static typing in Python
Python Type Checking (Guide)In this guide, you will get a look into Python type checking
Adding type hints to urllib3Tests are not enough: Case study adding type hints to urllib3
Adam Johnsons BlogAdam Johnson blogs about typing practices
ParamSpec GuideNewly released feature in allows you do a lot of advanced typing things with functions and their signatures
Static Typing Python DecoratorsAccurately static typing decorators in Python is an icky business. The wrapper function obfuscates type information required to statically determine the types of the parameters and the return values of the wrapped function

Awesome Python Typing / Communities

python/typingOfficial typing gitter chat
TypedDjangoOfficial organisation gitter chat
PythonRu#typingRussian slack chat (invites are ) about types
awesome-python227,763about 2 years agoCurated list of awesome Python frameworks, libraries, software and resources
python-typecheckers63over 4 years agoList of Python type checkers: static and runtime

Backlinks from these awesome lists:

More related projects: