typeapi
What it is and what it does
typeapi is a reflection library that standardizes how you inspect and work with Python type hints at runtime. It wraps the complexity of Python's typing module across different versions and provides a consistent interface for examining type annotations, whether they're simple types like `int`, generic types like `list[str]`, or union types like `int | str`. The package is particularly useful because it lets you use modern type syntax (PEP 585 and PEP 604) on Python versions that don't natively support them, bridging compatibility gaps.
The library depends only on typing-extensions and targets Python 3.8 and newer. It's actively maintained and carries no known security vulnerabilities. The MIT license places no restrictions on how you use it.
Use it for:
- Evaluate modern type hint syntax like `list[str]` and `int | str` on Python versions where native support is unavailable.
- Build type-aware code generation or validation tools that need a consistent API across Python versions.
- Implement runtime type checking or serialization frameworks that require deep introspection of type annotations.
- Create documentation or IDE tooling that needs to analyze and display type information uniformly.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a unified API for reflecting and introspecting Python type hints, including support for evaluating modern type syntax (PEP 585, PEP 604) on older Python versions.
Yes, if you need to work with type hints at runtime or support older Python versions while using modern type syntax. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a safe choice. Install only if you actually need type introspection; it's a specialized tool, not a general utility.
Install
typeapi on PyPI
pip
pip install typeapiuv
uv add typeapipoetry
poetry add typeapiInstalling typeapi
Before you install
Low friction install with a single runtime dependency (typing-extensions). Actively maintained with recent releases; last commit 2026-04-09 and latest release 2025-10-23 indicate ongoing development.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and closed projects with minimal obligations.
Quickstart
pip install typeapi
from typeapi import TypeHint
hint = TypeHint.from_string('list[str]')
print(hint)
Requires Python 3.8 or newer.
Verify before relying
- Whether typeapi handles all edge cases in type hint evaluation or has known limitations with complex nested generics.
- Performance characteristics when evaluating large numbers of type hints or deeply nested type structures.
- Specific use cases where this unified API provides advantages over direct use of the typing module.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — typing-extensions |
| Maintenance | actively maintained — 295 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 260,683/month — #8,394 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: typeapi-2.3.0-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
griffe-typingdocGriffe extension that enables inline…
permissive · top 15,000 on PyPI
eval-type-backportEnables newer Python typing syntax (like `X |…
permissive · top 1,000 on PyPI
types-beautifulsoup4Provides type hints for beautifulsoup4 code via…
permissive · top 5,000 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
typing-inspectProvides runtime inspection utilities for…
permissive · top 1,000 on PyPI
flake8-pep585A flake8 plugin that detects and flags…
copyleft · top 15,000 on PyPI
types-grpcio-reflectionProvides type hints for grpcio-reflection,…
permissive · top 15,000 on PyPI
inspect2Provides the Python 3.6 inspect module API on…
permissive · top 15,000 on PyPI
types-PillowProvides type stubs for Pillow, enabling static…
permissive · top 5,000 on PyPI
typishTypish provides runtime type checking and…
permissive · top 5,000 on PyPI