--- id: undictify version: "0.11.3" license: unclear license_treatment: permissive maintenance: dormant --- # undictify — Type-checked function calls at runtime License: permissive · Maintenance: dormant · Downloads: 89.8K/mo ## What it is and what it does Undictify is a runtime type-checking library that automatically validates function arguments and constructor parameters against their type annotations. It solves the problem of untyped or loosely-typed data (from JSON, external APIs, or dynamic sources) flowing into functions that expect specific types—catching type mismatches at runtime rather than letting them propagate as silent bugs or cryptic errors downstream. The library provides two main decorators: `@type_checked_call()` for functions and `@type_checked_constructor()` for class constructors. It's particularly useful for deserializing JSON into typed dataclasses or NamedTuples, where you can unpack a dictionary directly into a constructor and let undictify validate all fields match their declared types. It supports optional parameters, type conversions, and selective field skipping, making it practical for web handlers and data ingestion pipelines. Use it for: - Safely deserialize JSON responses into typed dataclasses without manual validation boilerplate - Validate HTTP request arguments in Flask/FastAPI handlers where query params arrive as strings - Catch type mismatches early when integrating with untyped or dynamically-typed libraries - Enforce type contracts on constructor calls when unpacking dictionaries from external sources - Reduce repetitive isinstance() checks in data validation code by deriving checks from annotations ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Enforces type annotations at runtime by wrapping function calls and constructors with automatic type-checking, raising TypeError when arguments don't match their declared types. Yes, if you work with untyped data sources (JSON, APIs, user input) and want runtime type safety without manual validation code. The low install friction and permissive license make it a low-risk addition. However, note that maintenance is dormant (last release 2022-08-12); verify compatibility with your Python version and consider whether the package's scope matches your needs before adopting it for new projects. ## Install pip install undictify uv add undictify poetry add undictify ## Installing undictify Before you install: Low install friction; pure Python wheel with no runtime dependencies. Maintenance is dormant—last release was 2022-08-12, over 1463 days ago, though the repository remains active and unarchived. License in practice: MIT license (permissive); you can use, modify, and distribute this package freely with minimal restrictions. Quickstart: from undictify import type_checked_call @type_checked_call() def times_two(value: int) -> int: return 2 * value result = times_two(3) # works times_two('3') # raises TypeError at runtime Verify before relying: - Whether the package works correctly with Python versions beyond 3.9 (classifiers list only 3.7, 3.8, 3.9) - Current compatibility with modern type annotation syntax (e.g., PEP 604 union syntax, PEP 585 generics) - Performance overhead of runtime type-checking on high-frequency function calls ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 89.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags runtime type checking, type-checked function calls, validate function arguments, enforce type annotations, JSON deserialization validation, dataclass type validation, dictionary unpacking with types, type-checking, data-validation, json-deserialization [View on SkillFed](https://skillfed.io/packages/undictify) · [View on PyPI](https://pypi.org/project/undictify/)