--- id: json-strong-typing version: "0.4.3" license: MIT license_treatment: permissive maintenance: aging --- # json-strong-typing — Type-safe data interchange for Python data classes License: permissive · Maintenance: aging · Downloads: 133.4K/mo ## What it is and what it does json-strong-typing bridges the gap between Python's type system and JSON interchange by providing bidirectional conversion between typed dataclasses and JSON. It handles complex types—UUIDs, decimals, datetimes, nested dataclasses, generics—without requiring you to inherit from a custom base class or modify your class definitions. The package also generates JSON schemas from Python types, which is useful for API documentation and validation. The core use case is working with strongly-typed Python objects in contexts where JSON is the wire format: cloud functions receiving HTTP payloads, API endpoints validating input, configuration file parsing, or OpenAPI specification generation. It operates on plain dataclasses and named tuples without imposing a framework dependency, making it suitable for third-party classes you don't control. Use it for: - Serialize dataclass instances to JSON for HTTP APIs or message queues, then deserialize responses back to typed objects. - Generate JSON schemas from dataclass definitions for OpenAPI specifications or JSON schema validation. - Parse JSON configuration files into strongly-typed Python objects with automatic type coercion. - Validate incoming JSON payloads against Python dataclass types in cloud functions or web handlers. - Convert between Python objects and JSON in microservices that communicate via JSON messages. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Serializes Python dataclasses to JSON and deserializes JSON back to typed objects, with support for complex types like UUIDs, decimals, and nested structures, plus JSON schema generation for validation and OpenAPI specs. Yes, if you work with dataclasses and JSON interchange. The package is stable (Production/Stable classifier), has no known vulnerabilities, and low install friction. The aging maintenance status (197 days since last release) is a minor concern but not disqualifying—the repository is active and the library is relatively mature. Install it if you need type-safe JSON serialization without framework lock-in. ## Install pip install json-strong-typing uv add json-strong-typing poetry add json-strong-typing ## Installing json-strong-typing Before you install: Low friction: pure Python wheel with only two lightweight runtime dependencies (jsonschema and typing_extensions). Maintenance status is aging—last release was 197 days ago—but the repository remains active and unarchived. License in practice: MIT license permits use in commercial and proprietary projects with minimal restrictions; attribution required. Quickstart: from dataclasses import dataclass from json_strong_typing.serialization import object_to_json, json_to_object @dataclass class Example: name: str value: int obj = Example(name="test", value=1) json_obj = object_to_json(obj) restored = json_to_object(Example, json_obj) Requires Python 3.9 or later; dataclasses must use type annotations. Verify before relying: - Whether custom serialization/deserialization hooks are well-documented and easy to implement for non-standard types. - Performance characteristics when handling large or deeply nested dataclass hierarchies. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 133.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags dataclass json serialization, type-safe json parsing, json schema generation, python dataclass to json, strongly typed json interchange, json validation with types, dataclass json deserialization, json-serialization, type-safety, dataclass-tools [View on SkillFed](https://skillfed.io/packages/json-strong-typing) · [View on PyPI](https://pypi.org/project/json-strong-typing/)