{"categories":[{"label":"Quality Assurance","url":"https://skillfed.io/packages/category/software-development-quality-assurance/3"}],"enrichment":{"capability":"Enforces Python type annotations at runtime using decorators, validating function inputs, outputs, and nested generic types without requiring a compiler or external dependencies.","skillfed_tags":["type-checking","runtime-validation","decorator"],"use_cases":["Add runtime type safety to Python functions during development and debugging without modifying core logic","Validate API endpoint inputs and outputs in web frameworks to catch type errors before they propagate","Enforce type contracts in dataclass-based data pipelines to catch schema violations early","Gradually migrate untyped Python codebases by decorating functions incrementally with runtime checks","Disable type checking in production (via `enabled=False`) while keeping it active in test environments"],"what_it_does":"Type Enforced is a pure-Python runtime type checker that validates function and method signatures against their type annotations at execution time. It works as a decorator that can be applied to functions, methods, and classes, checking both input arguments and return values against their declared types. The package supports standard Python types, union types (both `int | str` and `typing.Union` syntax), nested generics like `dict[str, list[int]]`, and many typing module constructs including `Optional`, `Literal`, and `Any`.\n\nThe decorator offers configurable behavior: strict mode raises exceptions on type mismatches, non-strict mode logs warnings instead, and clean traceback mode hides internal stack frames for clarity. For large iterables, you can sample a percentage of items rather than checking all of them to reduce overhead. It requires Python 3.11 or higher for full feature support, though older versions can use earlier package releases with limited capabilities.","worth_installing":"Yes, if you need runtime type validation for development or testing. The package is lightweight, actively maintained, has no dependencies, and works with modern Python. Best suited for catching type errors during development or in non-performance-critical code paths; consider static type checkers like mypy for production-grade type safety without runtime overhead."},"id":"type-enforced","links":{"html":"https://skillfed.io/packages/type-enforced","md":"https://skillfed.io/packages/type-enforced.md","pypi":"https://pypi.org/project/type-enforced/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-06-04","license_spdx":null,"license_treatment":"permissive","name":"type-enforced","python_support":"supports_current","summary":"A pure python type enforcer for python type annotations"},"popularity":{"monthly_downloads":295015,"position":7933,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2.6.0"}
