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

Overview

Awesome Python Typing Awesome Gitter

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

Contents

Full list of typed projects on PyPi is here.

Static type checkers

  • mypy - Optional static typing (PEP 484).
  • pyanalyze - Extensible static analyzer and type checker.
  • pycharm - IDE for Professional Developers.
  • pyre - Performant type-checker.
  • pyright - Fast type checker meant for large Python source bases. It can run in a “watch” mode and performs fast incremental updates when files are modified.
  • pytype - Tool to check and infer types - without requiring type annotations.

Dynamic type checkers

  • beartype - Unbearably fast O(1) runtime type-checking in pure Python.
  • pydantic - Data parsing using Python type hinting. Supports dataclasses.
  • pytypes - Provides a rich set of utilities for runtime typechecking.
  • strongtyping - Decorator which checks whether the function is called with the correct type of parameters.
  • typeguard - Another one runtime type checker.
  • typical - Data parsing and automatic type-coercion using type hinting. Supports dataclasses, standard classes, function signatures, and more.

Stub packages

Additional types

  • meiga - Simple, typed and monad-based Result type.
  • option - Rust like Option and Result types.
  • phantom-types - Phantom types.
  • returns - Make your functions return something meaningful, typed, and safe.
  • safetywrap - Fully typesafe, Rust-like Result and Option types.
  • typet - Length-bounded types, dynamic object validation.

Backports and improvements

  • typed-ast - Modified fork of CPython's ast module that parses # type: comments.
  • typing-extensions - Backported and experimental type hints.
  • typing-utils - Backport 3.8+ runtime typing utils(for eg: get_origin) & add issubtype & more.
  • typingplus - Backport support, dynamic is_instance and cast for abstract types.

Tools

Linters

Testing

Working with types

  • com2ann - Tool for translation of type comments to type annotations.
  • merge-pyi - Part of pytype toolchain, applies stub files onto source code.
  • mypy-protobuf - Tool to generate mypy stubs from protobufs.
  • mypy-silent - Silence mypy by adding or removing code comments.
  • mypyc - Compiles mypy-annotated, statically typed Python modules into CPython C extensions.
  • retype - Another tool to apply stubs to code.
  • pep585-upgrade - Pre-commit hook configured to automatically upgrade your type hints to the new native types implemented in PEP 585.
  • typing-inspect - The typing_inspect module defines experimental API for runtime inspection of types defined in the typing module.
  • typing-json - Lib for working with typed objects and JSON.

Helper tools to add annotations to existing code

  • autotyper - Automatically add simple return type annotations for functions (bool, None, Optional).
  • monkeytype - Collects 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.
  • pyannotate - Insert annotations into your source code based on call arguments and return types observed at runtime.
  • pyre infer - Pyre has a powerful feature for migrating codebases to a typed format. The infer command-line option ingests a file or directory, makes educated guesses about the types used, and applies the annotations to the files.
  • pytest-annotate - Pyannotate plugin for pytest.
  • pytest-monkeytype - MonkeyType plugin for pytest.
  • pytype annotate-ast - A work-in-progress tool to annotate the nodes of an AST with their Python types.
  • type4py - Deep Similarity Learning-Based Type Inference.
  • typilus - A deep learning algorithm for predicting types in Python. Also available as a GitHub action

Mypy plugins

Integrations

Articles

PEPs

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

Third-party articles

Communities

Related

  • awesome-python - Curated list of awesome Python frameworks, libraries, software and resources.
  • python-typecheckers - List of Python type checkers: static and runtime.
Owner
TypedDjango
We make types for Django framework!
TypedDjango
Simple Python style checker in one Python file

pycodestyle (formerly called pep8) - Python style guide checker pycodestyle is a tool to check your Python code against some of the style conventions

Python Code Quality Authority 4.7k Jan 01, 2023
open source tools to generate mypy stubs from protobufs

mypy-protobuf: Generate mypy stub files from protobuf specs We just released a new major release mypy-protobuf 2. on 02/02/2021! It includes some back

Dropbox 527 Jan 03, 2023
Tools for improving Python imports

imptools Tools for improving Python imports. Installation pip3 install imptools Overview Detailed docs import_path Import a module from any path on th

Danijar Hafner 7 Aug 07, 2022
Static Typing for Python

Python static typing home. Contains the source for typing_extensions and the documentation. Also hosts a user help forum.

Python 1.3k Jan 06, 2023
Tool to check the completeness of MANIFEST.in for Python packages

check-manifest Are you a Python developer? Have you uploaded packages to the Python Package Index? Have you accidentally uploaded broken packages with

Marius Gedminas 270 Dec 26, 2022
Flake8 extension to provide force-check option

flake8-force Flake8 extension to provide force-check option. When this option is enabled, flake8 performs all checks even if the target file cannot be

Kenichi Maehashi 9 Oct 29, 2022
🦆 Better duck-typing with mypy-compatible extensions to Protocol

🦆 Quacks If it walks like a duck and it quacks like a duck, then it must be a duck Thanks to PEP544, Python now has protocols: a way to define duck t

Arie Bovenberg 9 Nov 14, 2022
:sparkles: Surface lint errors during code review

✨ Linty Fresh ✨ Keep your codebase sparkly clean with the power of LINT! Linty Fresh parses lint errors and report them back to GitHub as comments on

Lyft 183 Dec 18, 2022
Collection of awesome Python types, stubs, plugins, and tools to work with them.

Awesome Python Typing Collection of awesome Python types, stubs, plugins, and tools to work with them. Contents Static type checkers Dynamic type chec

TypedDjango 1.2k Jan 04, 2023
Unbearably fast O(1) runtime type-checking in pure Python.

Look for the bare necessities, the simple bare necessities. Forget about your worries and your strife. — The Jungle Book.

beartype 1.4k Jan 01, 2023
mypy plugin to type check Kubernetes resources

kubernetes-typed mypy plugin to dynamically define types for Kubernetes objects. Features Type checking for Custom Resources Type checking forkubernet

Artem Yarmoliuk 16 Oct 10, 2022
Type annotations builder for boto3 compatible with VSCode, PyCharm, Emacs, Sublime Text, pyright and mypy.

mypy_boto3_builder Type annotations builder for boto3-stubs project. Compatible with VSCode, PyCharm, Emacs, Sublime Text, mypy, pyright and other too

Vlad Emelianov 2 Dec 05, 2022
Plugin for mypy to support zope.interface

Plugin for mypy to support zope.interface The goal is to be able to make zope interfaces to be treated as types in mypy sense. Usage Install both mypy

Shoobx 36 Oct 29, 2022
Flake8 wrapper to make it nice, legacy-friendly, configurable.

THE PROJECT IS ARCHIVED Forks: https://github.com/orsinium/forks It's a Flake8 wrapper to make it cool. Lint md, rst, ipynb, and more. Shareable and r

Life4 232 Dec 16, 2022
Pymxs, the 3DsMax bindings of Maxscript to Python doesn't come with any stubs

PyMXS Stubs generator What Pymxs, the 3DsMax bindings of Maxscript to Python doe

Frieder Erdmann 19 Dec 27, 2022
Tool for pinpointing circular imports in Python. Find cyclic imports in any project

Pycycle: Find and fix circular imports in python projects Pycycle is an experimental project that aims to help python developers fix their circular de

Vadim Kravcenko 311 Dec 15, 2022
Flake8 extension for checking quotes in python

Flake8 Extension to lint for quotes. Major update in 2.0.0 We automatically encourage avoiding escaping quotes as per PEP 8. To disable this, use --no

Zachary Heller 157 Dec 13, 2022
Design by contract for Python. Write bug-free code. Add a few decorators, get static analysis and tests for free.

A Python library for design by contract (DbC) and checking values, exceptions, and side-effects. In a nutshell, deal empowers you to write bug-free co

Life4 473 Dec 28, 2022
A framework for detecting, highlighting and correcting grammatical errors on natural language text.

Gramformer Human and machine generated text often suffer from grammatical and/or typographical errors. It can be spelling, punctuation, grammatical or

Prithivida 1.3k Jan 08, 2023
flake8 plugin to catch useless `assert` statements

flake8-useless-assert flake8 plugin to catch useless assert statements Download or install on the PyPI page Violations Code Description Example ULA001

1 Feb 12, 2022