Schematics – Python Data Structures for Humans
github.com
github.com
Is really mature and I've found it to be a wonderful tool - it has an addon called Deform for serializing forms into colander schemas but colander is not limited to that.
I've used it for creating "schemas" for API endpoints and validating them. It would be nice to use it DB backed ORMs but even there you're kind of covered with a SQLAlchemy Colander attachment...
Choice is good! If you dig Schematics, check out Colander too.
https://github.com/alecthomas/voluptuous
Voluptuous is perfect for putting as validation in from of a JSON API. Not sure what I would use schematics for
Also, do you have any thoughts about hooking something like this up to sqlalchemy?
We use schematics to back the data on our domain models. It provides models that are separate from persistence models that live in the data / client layer (database or external service bound), and gives you a few nice things for free (like validation) and you can attach behavior to them.
The only things I would like to see added are:
- A native polymorphic type (we're going to try and submit a pull request with our implementation within the next month)
- Roles (lists of fields that are output) optionally separated from the models.
- Support for redefining a model (currently it is difficult to add a self referencing field and have schematics pick it up for you, or add fields through mixins).