Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Typedload 2.25 is out Pure Python schema validation still faster than Rust (ltworf.github.io)
8 points by LtWorf on Aug 27, 2023 | hide | past | favorite | 1 comment


Benchmarks: https://ltworf.github.io/typedload/performance.html (I'm proud to have a benchmark page that I didn't need to remove in shame).

typedload is a schema validation library to load data from json/bson/yaml/whatever into python typed data structures (dataclass/NamedTuple/attr) and dump it back.

It is very fast, it supports commonly used python data structures rather than requiring to inherit or decorate everything in the code, so it's easy to adopt (or drop).

It handles unions really well, including complicated cases that don't work with msgspec and other such libraries.

Main differences from pydantic:

* Designed from the start with mypy in mind * Much smaller in size (kb vs mb) * Designed to use attr or dataclass for custom validators, rather than (badly) reinventing the wheel * API breaking changes only happen on major releases




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: