I think main use cases for Jsonic over Pydantic are: - You already have plain Python classes or dataclasses and don’t want to convert them to BaseModel - You prefer minimal intrusion - no inheritance, no decorators, no schema definitions - You need to serialize and deserialize Pydantic models alongside non-Pydantic classes
Having said that, Pydantic is the better choice in most cases.
This is also why Jsonic integrate natively with Pydantic so you can serialize Pydantic models using Jsonic out of the box
The fact that all your projects use Pydantic makes it an easy starting point and created standardisation - of course.
Nevertheless, I can definitely see some use-cases for lightweight JSON-serialisation without bringing in Pydantic. Dataclasses are great, but lack proper json handling.
I also don't think either Pydantic or msgspec struggles with any of the "gotcha" cases in the post. Both can understand enums, type tagging, literals, etc.
orrbenyamini•6d ago
I built it after repeatedly running into friction with Python’s built-in json module when working with classes, dataclasses, nested objects, and type hints.
Jsonic focuses on: - Zero-boilerplate serialization and deserialization - Strict type validation with clear errors - Natural support for dataclasses, enums, tuples, sets, nested objects etc. - Optional field exclusion (e.g. hiding sensitive data) - Extra features like transient fields definition, suport for __slots__ classes etc. - Clean interop with Pydantic models
The goal is to make JSON round-tripping feel Pythonic and predictable without writing to_dict() / from_dict() everywhere.
I’d really appreciate feedback on the API design and tradeoffs.
memoriuaysj•1h ago
your comment above has the same broken formatting
does not inspire confidence if you can't spot such obvious breakage