koda-validate
typedload
Our great sponsors
koda-validate | typedload | |
---|---|---|
10 | 5 | |
108 | 252 | |
- | - | |
5.2 | 8.0 | |
21 days ago | 7 days ago | |
Python | Python | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
koda-validate
-
Pydantic V2 leverages Rust's Superpowers [video]
As someone who built a pure python validation library[0] that's much faster than pydantic (~1.5x - 12x depending on the benchmark), I have to say that this whole focus on Rust seems premature. There's clearly a lot of room for pydantic to optimize its Python implementation.
Beyond that, rust seems like a great fit for tooling (i.e. ruff), but as a library used at runtime, it seems a little odd to make a validation library (which can expect to receive any kind of data valid python data) to also be constrained by a separate set of data types which are valid in rust.
[0]: https://github.com/keithasaurus/koda-validate
-
beartype: It has documentation now. It only took two years, my last hair follicle, precious sanity points (SPs), and working with Sphinx. Don't be like @leycec. Go hard on documentation early.
For the sake of comparison I built a validate_signature function as part of koda-validate, which has a lot of overlap with beartype. I haven't really compared it to beartype, so I'd be interested to see people's thoughts on how the two approaches compare.
-
Pydantic vs Protobuf vs Namedtuples vs Dataclasses
FYI I wrote koda-validate, which is significantly faster than pydantic, has a similar API, and is pure python.
- Koda Validate: Alternative to Pydantic that is faster, more flexible, and async-compatible.
- I built a composable validation library. It plays nice with type hints and asyncio. Would love some feedback!
- Koda Validate: Flexible, Explicit, Async-compatible Validation in Python
- Show HN: Koda Validate 2.0 – Async Validation in Python
-
This Week In Python
koda-validate – Typesafe Validation
- Show HN: Koda Validate – Typesafe, combinable validation for Python
typedload
-
Show HN: Up to 100x Faster FastAPI with simdjson and io_uring on Linux 5.19
Author of typedload here!
FastAPI relies on (not so fast) pydantic, which is one of the slowest libraries in that category.
Don't expect to find such benchmarks on the pydantic documentation itself, but the competing libraries will have them.
[0] https://ltworf.github.io/typedload/
-
Pydantic vs Protobuf vs Namedtuples vs Dataclasses
I wrote typedload, which is significantly faster than pydantic. Just uses normal dataclasses/attrs/NamedTuple, has a better API and is pure Python!
- Informatica serve a qualcosa?
-
Show HN: Python framework is faster than Golang Fiber
I read all the perftests in the repo. I think they nearly all parse a structure that contains a repetition of the same or similar thing a couple hundred thousand times times and the timing function returns the min and max of 5 attempts. I just picked one example for posting.
Not a Python expert, but could the Pydantic tests be possibly not realistic and/or misleading because they are using kwargs in __init__ [1] to parse the object instead of calling the parse_obj class method [2]? According to some PEPs [3], isn't Python creating a new dictionary for that parameter which would be included in the timing? That would be unfortunate if that accounted for the difference.
Something else I think about is if a performance test doesn't produce a side effect that is checked, a smart compiler or runtime could optimize the whole benchmark away. Or too easy for the CPU to do branch prediction, etc. I think I recall that happening to me in Java in the past, but probably not happened here in Python.
[1] https://github.com/ltworf/typedload/blob/37c72837e0a8fd5f350...
[2] https://docs.pydantic.dev/usage/models/#helper-functions
[3] https://peps.python.org/pep-0692/
What are some alternatives?
pydantic-core - Core validation logic for pydantic written in rust
codon - A high-performance, zero-overhead, extensible Python compiler using LLVM
katara - Synthesize CRDTs from classic data types with verified lifting!
ustore - Multi-Modal Database replacing MongoDB, Neo4J, and Elastic with 1 faster ACID solution, with NetworkX and Pandas interfaces, and bindings for C 99, C++ 17, Python 3, Java, GoLang 🗄️
flake8-comments - Report redundant comments in python code
serialite - Serialization and deserialization library for Python
peps - Python Enhancement Proposals
django-pgtransaction - A context manager/decorator which extends Django's atomic function with the ability to set isolation level and retries for a given transaction.
msgspec - A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML
socketify.py - Bringing Http/Https and WebSockets High Performance servers for PyPy3 and Python3