--- id: typeapi version: "2.3.0" license: MIT license_treatment: permissive maintenance: active --- # typeapi License: permissive · Maintenance: active · Downloads: 260.7K/mo ## 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 above — 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 pip install typeapi uv add typeapi poetry add typeapi ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 260.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python type hint introspection, type annotation reflection api, pep 585 pep 604 support, runtime type hint evaluation, typing introspection library, type hint compatibility layer, python type system reflection, type-hints, reflection, compatibility [View on SkillFed](https://skillfed.io/packages/typeapi) · [View on PyPI](https://pypi.org/project/typeapi/)