json-strong-typing
Type-safe data interchange for Python data classes
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 on this page — 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
json-strong-typing on PyPI
pip
pip install json-strong-typinguv
uv add json-strong-typingpoetry
poetry add json-strong-typingInstalling 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 the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — jsonschema, typing_extensions |
| Maintenance | aging — 197 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 133,360/month — #11,517 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: json_strong_typing-0.4.3-py3-none-any.whl
Keywords: json-schema, json-parsing, json-serialization, docstring-documentation, type-inspection
Tags
More JSON packages
jsonschema validates Python data structures…
permissive · top 100 on PyPI
referencingResolves JSON references according to JSON…
permissive · top 100 on PyPI
jsonschema-specificationsProvides JSON Schema metaschemas, vocabularies,…
permissive · top 100 on PyPI
jiterA fast JSON parser that converts bytes into…
permissive · top 1,000 on PyPI
holidaysGenerates country- and subdivision-specific…
permissive · top 1,000 on PyPI
rfc8785Implements RFC 8785 (JSON Canonicalization…
permissive · top 5,000 on PyPI
databind.jsonDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
interchangeInterchange provides data types and interchange…
permissive · top 15,000 on PyPI
databindDatabind deserializes JSON-like nested data…
permissive · top 15,000 on PyPI
databind.coreDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
jsonaliasProvides a recursive type alias for…
permissive · top 5,000 on PyPI
orjsonorjson is a fast JSON serialization and…
copyleft · top 1,000 on PyPI
py-serializableSerializes and deserializes Python classes to…
permissive · top 1,000 on PyPI
apischemaApischema handles JSON…
permissive · top 15,000 on PyPI
gensonGenSON generates JSON Schema documents from…
permissive · top 5,000 on PyPI
warchant_dc_schemaGenerates JSON Schema (2020-12 draft) from…
permissive · top 15,000 on PyPI