--- id: typing-utils version: "0.1.0" license: Apache License 2.0 license_treatment: permissive maintenance: abandoned --- # typing-utils — utils to inspect Python type annotations License: permissive · Maintenance: abandoned · Downloads: 1.0M/mo ## What it is and what it does typing-utils is a utility library for inspecting and validating Python type annotations. It provides four main functions: issubtype() checks whether one type is a subtype of another (including support for unions, nested types, and forward references); get_origin() extracts the unsubscripted base of a generic type; get_args() retrieves the type arguments from a parameterized type; and get_type_hints() resolves type hints while handling forward references and optional defaults. The package was designed as a backport of typing utilities for Python 3.6 and 3.7, but many of its functions now exist in the standard library for Python 3.8+. It has no runtime dependencies and installs cleanly, but development stopped in 2021 and the repository is no longer maintained. Before adopting it, verify whether the standard library or a more actively maintained alternative meets your needs. Use it for: - Validate that function argument types conform to expected type hierarchies in runtime type-checking frameworks - Introspect generic types to extract their origin and arguments for dynamic type processing or serialization - Resolve forward references in type hints when working with recursive or mutually-referential type definitions - Support type checking on Python 3.6–3.7 where standard library typing utilities are incomplete ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides utilities to inspect and validate Python type annotations, including functions to check subtype relationships, extract type origins and arguments, and resolve forward references in type hints. No, unless you are maintaining legacy code on Python 3.6–3.7. For Python 3.8+, use the standard library's typing.get_origin and typing.get_args instead. The package is abandoned (last commit November 2022, no releases since May 2021) and offers no advantages over maintained alternatives or built-in functionality. If you do need it for legacy support, the lack of security vulnerabilities and permissive license make it safe to use, but expect no future maintenance. ## Install pip install typing-utils uv add typing-utils poetry add typing-utils ## Installing typing-utils Before you install: Low install friction with no runtime dependencies. However, the package is abandoned—last commit was 2022-11-09 and no releases since 2021-05-23. Consider whether its functionality is already available in your target Python version's standard library before adopting. License in practice: Licensed under Apache License 2.0, a permissive license. You may use, modify, and distribute the package freely in commercial and private projects, provided you include a copy of the license and state significant changes. Quickstart: pip install typing-utils from typing_utils import issubtype, get_origin, get_args import typing # Check if list is a subtype of typing.Sequence result = issubtype(list, typing.Sequence) # Get the origin of a generic type origin = get_origin(typing.List[int]) # Get type arguments args = get_args(typing.Dict[str, int]) Requires Python 3.6.1 or later. Many of these utilities are now available in the standard library (typing.get_origin, typing.get_args in Python 3.8+), so check whether you actually need this backport. Verify before relying: - Whether issubtype handles all edge cases correctly for complex nested and recursive types in production use - Compatibility with Python versions beyond 3.9 (last tested version in classifiers) - Whether standard library equivalents in Python 3.8+ make this package redundant for your use case ## Package facts - License: Apache License 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 1.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags type annotation inspection, issubtype type checking, get_origin get_args typing, forward reference resolution, type hints validation, typing utilities backport, generic type introspection, type-checking, backport, abandoned [View on SkillFed](https://skillfed.io/packages/typing-utils) · [View on PyPI](https://pypi.org/project/typing-utils/)