News for hackers. Stuff that matters.
Re:Schematics – Python Data Structures for Humans by Ixiaus on Sunday October 19, 2014 @11:32AM (#8478514)
http://colander.readthedocs.org/en/latest/

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...

Re:Schematics – Python Data Structures for Humans by jmsdnns on Sunday October 19, 2014 @04:24PM (#8479491)
Hey, one of the authors of Schematics here. I think Colander rocks. I had no idea about it until two years into the Schematics project and we just kept going.

Choice is good! If you dig Schematics, check out Colander too.

Re:Schematics – Python Data Structures for Humans by rav on Sunday October 19, 2014 @08:53AM (#8478108)
With my CS background, I find this usage of "Data Structures" in the title confusing. I was expecting some sort of visualization framework for viewing tree/graph structures, so I think the title is a bit misleading.
Re:Schematics – Python Data Structures for Humans by kps on Sunday October 19, 2014 @12:35PM (#8478707)
I thought it was going to be about data structures for circuit design.
Re:Schematics – Python Data Structures for Humans by calpaterson on Sunday October 19, 2014 @04:54AM (#8477681)
This seems like a more developed version of voluptuous (a validation library):

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

Re:Schematics – Python Data Structures for Humans by kanzure on Sunday October 19, 2014 @10:02AM (#8478259)
Cool. What about using traitlets to get a larger type library? For example, see: https://github.com/kanzure/modelo

Also, do you have any thoughts about hooking something like this up to sqlalchemy?

Re:Schematics – Python Data Structures for Humans by jmsdnns on Monday October 20, 2014 @11:37AM (#8482644)
There is a project on the Schematics org page for using with sqlalchemy. I haven't used it myself, but I would look there first.

https://github.com/schematics/schemalchemy

Re:Schematics – Python Data Structures for Humans by reinhardt on Sunday October 19, 2014 @11:32AM (#8478516)
More Python data validation packages here: https://github.com/vinta/awesome-python#data-validation. Personally I dig Valideer.
Re:Schematics – Python Data Structures for Humans by webmdee on Sunday October 19, 2014 @02:14AM (#8477394)
I don't fully understand the purpose of this
Re:Schematics – Python Data Structures for Humans by ryanknapp on Sunday October 19, 2014 @02:30AM (#8477421)
Schematics makes it easy to specify an API interface. It will let you bind / coerce json to your types, and then validate that the provided json bound exactly (no extra fields, no missing required fields, custom validators). We also extended it to provide a polymorphic type that will bind to a class based on a discriminator value in the json (based on an old gist from one of the schematics contributors). The roles definition also allows you to provide different serialized views of a model (though whether the model should be aware of that concern is questionable, but a nice shortcut).

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).
Re:Schematics – Python Data Structures for Humans by 88e282102ae2e5b on Sunday October 19, 2014 @01:50PM (#8478949)
How does the implementation of OrderedDict differ from the one in the standard library?
Re:Schematics – Python Data Structures for Humans by jmsdnns on Monday October 20, 2014 @11:38AM (#8482648)
It may be similar now. It was borrowed from Django before there was one in the stllib