typeguard
Run-time type checker for Python
Decision gist · record as of 2026-08-14
Yes. typeguard is actively maintained, has low install friction, carries no known vulnerabilities, and solves a real gap between static and runtime type safety. Install it if you need runtime type validation—either selectively via check_type() or wholesale via instrumentation—to catch type errors that static checkers cannot.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction install with a single runtime dependency (typing_extensions).
- Active maintenance with a recent release and sustained development since 2015.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
last release 2026-07-26 (19 days) · last repo commit 2026-07-26 · 1,779 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 77,468,346 downloads/mo, #439 on PyPI
Alternatives
Verify before relying
pip install typeguard
from typeguard import check_type
check_type(value, int) # validates value is int type- Performance overhead of runtime type checking on hot code paths.
- Compatibility with third-party import hooks or instrumentation frameworks.
- Coverage of edge cases in complex generic and union types.
What it is and what it does
typeguard adds runtime type validation to Python code, complementing static type checkers by catching type errors that only emerge when code runs. It works with PEP 484 type annotations on function arguments, return values, and local variables. The library offers three approaches: a check_type() function for ad-hoc validation similar to isinstance() but supporting complex types, decorator-based checking via check_argument_types() and check_return_type(), and bytecode instrumentation that automatically injects type checks into entire modules or individual functions.
Instrumentation can be applied either through the @typechecked decorator on specific functions or via an import hook that transparently instruments targeted modules on import. For generator and async functions, it validates yield and send values. The library is actively maintained, supports current Python versions, and carries no known security vulnerabilities.
Use it for
- Catch type mismatches in production code that static type checkers miss due to dynamic behavior or third-party libraries.
- Add type safety to legacy codebases incrementally by instrumenting modules without modifying their source.
- Validate function arguments and return values in libraries that accept or return complex generic types.
- Debug type-related issues in dynamically generated or metaprogrammed code.
- Enforce stricter type contracts in critical code paths where runtime guarantees matter.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
typeguard is actively maintained, has low install friction, carries no known vulnerabilities, and solves a real gap between static and runtime type safety. Install it if you need runtime type validation—either selectively via check_type() or wholesale via instrumentation—to catch type errors that static checkers cannot.
Install
typeguard on PyPI
Before you install
Low friction install with a single runtime dependency (typing_extensions). Active maintenance with a recent release and sustained development since 2015.
Requires Python 3.10 or later.
License in practice
MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install typeguard
from typeguard import check_type
check_type(value, int) # validates value is int type
Verify before relying
- Performance overhead of runtime type checking on hot code paths.
- Compatibility with third-party import hooks or instrumentation frameworks.
- Coverage of edge cases in complex generic and union types.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping_extensions |
| Maintenance | Actively maintained 19 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 77,468,346 / month, #439 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15 |
Evidence: typeguard-4.6.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “runtime type checking”
- typeguardPerforms run-time type checking for Python functions and objects…
- strongtypingA runtime type-checking decorator that validates function arguments…
- beartypeBeartype is a runtime type checker that validates Python type hints…
Give your agent the search over MCP, or paste the wish link into any chat.
More Quality Assurance packages
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.
Install it if you work with CloudFormation templates.
See also dargs · typing-inspection · phantom-types · flake8-annotations · beartype · torchtyping · typed-ast · types-Werkzeug · types-attrs · types-cryptography