--- id: strongtyping version: "3.14.5" license: CC-BY-ND-4.0 license_treatment: permissive maintenance: active --- # strongtyping — Decorator which checks whether the function is called with the correct type of parameters License: permissive · Maintenance: active · Downloads: 142.3K/mo ## What it is and what it does strongtyping is a runtime type-checking decorator for Python functions that validates arguments against their type annotations at call time. When a function is decorated with @match_typing, the decorator intercepts calls and checks that each argument matches its declared type; if not, it raises a TypeMismatch exception. This catches type errors that static type checkers like mypy might miss, particularly in dynamic code paths or when working with external data. The package includes specialized support for async functions via @a_match_typing, which preserves the coroutine interface while performing the same validation. Since version 3.13.6, the core logic is compiled with mypyc for performance. The library targets Python 3.14 and above, uses ujson for serialization, and includes pytest and ruff in its development stack. It's maintained actively and documented on readthedocs. Use it for: - Validate API endpoint parameters at runtime before processing, catching type errors from client requests. - Enforce type contracts in data processing pipelines where external or user-provided data enters functions. - Debug type-related bugs in dynamic code by catching mismatches early rather than at point of failure. - Protect async functions from type errors in concurrent workflows where static analysis may be incomplete. - Supplement mypy or other static checkers in codebases where runtime type safety is critical. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A runtime type-checking decorator that validates function arguments against their type annotations and raises TypeMismatch on mismatch, with dedicated async support and mypyc compilation for performance. Yes, if you target Python 3.14+ and need runtime type validation as a safety layer. The active maintenance, zero known vulnerabilities, and mypyc performance boost make it solid for production use. The CC-BY-ND-4.0 license is permissive but requires attribution. Not suitable if you're on Python 3.13 or earlier. ## Install pip install strongtyping uv add strongtyping poetry add strongtyping ## Installing strongtyping Before you install: Medium install friction due to compiled wheels for specific Python versions. Active maintenance with recent release (17 days old) and steady repository activity. Requires Python 3.14 or above, which limits adoption to very recent Python versions. License in practice: Licensed under CC-BY-ND-4.0, a permissive license that allows use and modification but requires attribution and prohibits derivative works. Suitable for most projects, though the non-derivative restriction may constrain some use cases. Quickstart: pip install strongtyping from strongtyping.strong_typing import match_typing @match_typing def add(left: int, right: int) -> int: return left + right result = add(1, 2) # 3 add(1, "2") # raises TypeMismatch Requires Python 3.14 or above; older Python versions are not supported. Verify before relying: - Whether mypyc compilation provides the claimed 5x performance boost in real-world usage patterns. - How TypeMismatch exceptions integrate with existing error handling and logging frameworks. - Whether the AI Agent Skills integration provides practical value beyond documentation. ## Package facts - License: CC-BY-ND-4.0 (permissive) - Python support: capped_below_current - Install friction: medium - Maintenance: active - Downloads: 142.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags runtime type checking decorator, function argument type validation, type mismatch detection, async function type checking, runtime type enforcement, type annotation validator, dynamic type checking, runtime-type-checking, async-support, decorator-based [View on SkillFed](https://skillfed.io/packages/strongtyping) · [View on PyPI](https://pypi.org/project/strongtyping/)