koda-validate
cinder
Our great sponsors
koda-validate | cinder | |
---|---|---|
10 | 43 | |
108 | 3,375 | |
- | 0.8% | |
5.2 | 9.4 | |
21 days ago | 6 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
cinder
-
Meta Used Monolithic Architecture to Ship Threads in Only Five Months
Meta is actually contributing directly to upstream cpython. If you really wanted to, the internal fork is also open source: https://github.com/facebookincubator/cinder
- Meta pledges Three-Year sponsorship for Python if GIL removal is accepted
- Back end of Meta Threads is built with Python 3.10 with some interesting tweaks
-
Lessons from Mojo for PHP 10+ ?
Just one example: last year Meta open-sourced Cinder, which powers Instagram and provides sizeable speedups compared to CPython.
- Python true static typing
-
Best book on writing an optimizing compiler (inlining, types, abstract interpretation)?
I used to work on the Cinder JIT and can help document any passes you find interesting or confusing.
-
Python-based compiler achieves orders-of-magnitude speedups
You might enjoy Cinder then. It's based on CPython so it is nearly 100% compatible.
https://github.com/facebookincubator/cinder/
Disclaimer: I used to work on it.
-
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.
I think Cinder's Static Python, which also performs runtime type checking, is more ambitious. Though it's not production ready yet.
-
If there’s gonna be a Python 4.0 one day, what’s a breaking change you’d like to see? Let’s explore the ideas you have that can make Python even better!
Here's a fork that implements that https://github.com/facebookincubator/cinder - it might be nice to one day get that up streamed but obviously it'll be controversial and it certainly needs more time to bake. Hopefully at some point we can make it a pip installable extension though.
-
Is it time for Python to have a statically-typed, compiled, fast superset?
The other thing that was interesting to me, was the potential of type annotations to help make for a faster, safer experience on the compiler end of things. One example is seen in Meta’s Cinder project, on the docs it explains how typing can be used to reduce the number of steps for the compiler ([cinder/static_python.rst at cinder/3.8 · facebookincubator/cinder · GitHub](https://github.com/facebookincubator/cinder/blob/cinder/3.8/CinderDoc/static_python.rst)), making it more effective.
What are some alternatives?
pydantic-core - Core validation logic for pydantic written in rust
faster-cpython - How to make CPython faster.
katara - Synthesize CRDTs from classic data types with verified lifting!
Pyjion - Pyjion - A JIT for Python based upon CoreCLR
flake8-comments - Report redundant comments in python code
Pyjion
serialite - Serialization and deserialization library for Python
graalpython - A Python 3 implementation built on GraalVM
typedload - Python library to load dynamically typed data into statically typed data structures
MonkeyType - A Python library that generates static type annotations by collecting runtime types
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.
hpy - HPy: a better API for Python