frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Jsonic – Python JSON serialization that works

https://medium.com/dev-genius/jsonic-python-serialization-that-just-works-3b38d07c426d
20•orrbenyamini•6d ago

Comments

orrbenyamini•6d ago
Hi HN - I’m the author of Jsonic.

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
all the quoted Python code on the medium post has broken formatting

your comment above has the same broken formatting

does not inspire confidence if you can't spot such obvious breakage

leobg•5d ago
Looks useful. Will try it out. Thanks for making it.
fucalost•5d ago
Sorry to be a hater, but wouldn’t using Pydantic be better in almost every circumstance here?
orrbenyamini•5d ago
Pydantic is great lib and and has many advantages over Jsonic,

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

japborst•5d ago
I can see that. Pydantic is great but relatively slow (which matters on edge devices) and can be bloated.

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.

dcreater•1h ago
The article would benefit from a very clear and explicit section on pydantic model_dump_json() vs your tool. As that's the primary thing you're tool is likely competing against
mukundesh•56m ago
Thanks for sharing, could you please comment on the performance aspect vis-a-vis json reader/writer provided by pydantic
BugsJustFindMe•44m ago
Do you handle JSON numbers safely by default or do you require that people make their own deserializers for numbers that would lose precision when coerced into Python's float type? The most common mistake that I see JSON libraries make is using fixed precision floating point types somewhere in the process when handling numbers while JSON's number type specifies no such limitation, which then causes precision loss unless people catch the problem and do their own pre-serialization.
woodruffw•2m ago
The degree of LLM writing here makes it hard to determine which parts of this are novel and which parts are derivations of existing popular libraries like Pydantic and msgspec.

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.

Ask HN: Who is hiring? (January 2026)

85•whoishiring•1h ago•42 comments

FracturedJson

https://github.com/j-brooke/FracturedJson/wiki
331•PretzelFisch•5h ago•81 comments

10 years of personal finances in plain text files

https://sgoel.dev/posts/10-years-of-personal-finances-in-plain-text-files/
292•wrxd•6h ago•105 comments

Punkt. Unveils MC03 Smartphone

https://www.punkt.ch/blogs/news/punkt-unveils-mc03
38•ChrisArchitect•1h ago•30 comments

Clicks Communicator

https://www.clicksphone.com/en/communicator
24•microflash•25m ago•8 comments

Assorted less(1) tips

https://blog.thechases.com/posts/assorted-less-tips/
91•todsacerdoti•5h ago•20 comments

39th Chaos Communication Congress Videos

https://media.ccc.de/b/congress/2025
240•Jommi•4h ago•32 comments

Standard Ebooks: Public Domain Day 2026 in Literature

https://standardebooks.org/blog/public-domain-day-2026
251•WithinReason•9h ago•41 comments

HPV vaccination reduces oncogenic HPV16/18 prevalence from 16% to <1% in Denmark

https://www.eurosurveillance.org/content/10.2807/1560-7917.ES.2025.30.27.2400820
344•stared•7h ago•171 comments

Why users cannot create Issues directly

https://github.com/ghostty-org/ghostty/issues/3558
621•xpe•16h ago•220 comments

Happy Public Domain Day 2026

https://publicdomainreview.org/blog/2026/01/public-domain-day-2026/
386•apetresc•16h ago•75 comments

Show HN: Dealta – A game-theoretic decentralized trading protocol

https://github.com/orgs/Dealta-Foundation/repositories
40•kalenvale•5h ago•11 comments

ThingsBoard: Open-Source IoT Platform

https://github.com/thingsboard/thingsboard
14•pretext•5d ago•3 comments

A small collection of text-only websites

https://shkspr.mobi/blog/2025/12/a-small-collection-of-text-only-websites/
65•danielfalbo•6h ago•26 comments

Miri: Practical Undefined Behavior Detection for Rust [pdf]

https://research.ralfj.de/papers/2026-popl-miri.pdf
4•ingve•4d ago•0 comments

A website to destroy all websites

https://henry.codes/writing/a-website-to-destroy-all-websites/
681•g0xA52A2A•21h ago•340 comments

Matz 2/2: The trajectory of Ruby's growth, Open-Source Software today etc.

https://en.kaigaiiju.ch/episodes/matz2
77•kibitan•1w ago•36 comments

Can I throw a C++ exception from a structured exception?

https://devblogs.microsoft.com/oldnewthing/20170728-00/?p=96706
50•birdculture•4d ago•12 comments

What You Need to Know Before Touching a Video File

https://gist.github.com/arch1t3cht/b5b9552633567fa7658deee5aec60453/
122•qbow883•5d ago•92 comments

FreeBSD: Home NAS, part 1 – configuring ZFS mirror (RAID1)

https://rtfm.co.ua/en/freebsd-home-nas-part-1-configuring-zfs-mirror-raid1/
109•todsacerdoti•10h ago•27 comments

Show HN: I built a clipboard tool to strip/keep specific formatting like Italics

https://custompaste.com
24•EvaWorld9•5h ago•9 comments

Cameras and Lenses (2020)

https://ciechanow.ski/cameras-and-lenses/
493•sebg•1d ago•53 comments

Can Bundler be as fast as uv?

https://tenderlovemaking.com/2025/12/29/can-bundler-be-as-fast-as-uv/
319•ibobev•20h ago•95 comments

Show HN: Jsonic – Python JSON serialization that works

https://medium.com/dev-genius/jsonic-python-serialization-that-just-works-3b38d07c426d
20•orrbenyamini•6d ago•10 comments

Parental Controls Aren't for Parents

https://beasthacker.com/til/parental-controls-arent-for-parents.html
183•beasthacker•4h ago•166 comments

Contact the ISS

https://www.ariss.org/contact-the-iss.html
81•logikblok•5d ago•23 comments

Joseph Campbell Meets George Lucas – Part I (2015)

https://www.starwars.com/news/mythic-discovery-within-the-inner-reaches-of-outer-space-joseph-cam...
36•indigodaddy•1d ago•15 comments

Marmot – A distributed SQLite server with MySQL wire compatible interface

https://github.com/maxpert/marmot
159•zX41ZdbW•15h ago•32 comments

Linux is good now

https://www.pcgamer.com/software/linux/im-brave-enough-to-say-it-linux-is-good-now-and-if-you-wan...
1017•Vinnl•21h ago•818 comments

One Number I Trust: Plain-Text Accounting for a Multi-Currency Household

https://lalitm.com/post/one-number-i-trust/
91•ayi•7h ago•59 comments