Registry / serialization / json-strong-typing

json-strong-typing

JSON →
library0.4.3pypypiunverified

A Python library for type-safe JSON serialization and deserialization using Python dataclasses. It enforces strict type checking, supports nested dataclasses, generic types, and optional fields. Current version 0.4.3, requires Python >=3.9, released under MIT license. Maintenance is active with periodic updates.

pip install json-strong-typing
INSTALL
IMPORT
SIG · JSON-STRONG-TYPING
J
json-strong-typing
serializationpythonv0.4.3
Install
2.4s avg
Import
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 21.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.000s · 22MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JsonDataclass
from strong_typing import JsonDataclass
from strong_typing import JsonDataclass

Define a dataclass extending JsonDataclass, then serialize/deserialize using json_serialize and json_deserialize.

from dataclasses import dataclass from strong_typing import JsonDataclass, json_serialize, json_deserialize @dataclass class Person(JsonDataclass): name: str age: int p = Person(name="Alice", age=30) serialized = json_serialize(p) print(serialized) deserialized = json_deserialize(Person, serialized) print(deserialized)
Debug
Known issues
gotchaThe library is imported as 'strong_typing', not 'json_strong_typing'. Many users mistakenly pip install 'json-strong-typing' and then try import json_strong_typing, which fails.
fix
Use 'import strong_typing' or 'from strong_typing import ...'.
affects: all
gotchaAll fields in the dataclass must have type annotations; otherwise, the library may raise an error or silently skip them.
fix
Ensure every field has a type annotation (e.g., name: str, age: int).
affects: all
gotchaWhen using Optional types, use typing.Optional or | None (Python 3.10+). The library distinguishes between missing and None values.
fix
Use field: Optional[int] = None or field: int | None = None.
affects: 0.4.x
deprecatedIn older versions (pre-0.4.0), the main class was JsonDataclass from 'strong_typing' but some users used 'from strong_typing import JsonDataclassJSON' which no longer exists.
fix
Upgrade to 0.4.x and use 'from strong_typing import JsonDataclass'.
affects: <0.4.0
Upgrade
Version history
0.4.3latest on PyPI · released Jan 29, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
json-strong-typing — pip install json-strong-typing · libregistry