Python Data Structures for Humans™.
>>> from schematics.models import Model
>>> from schematics.types import StringType
>>> class Person(Model):
... name = StringType(required=True)
...
>>> person = Person({'name': u'Joey Bada$$'})
>>> person.name
u'Joey Bada$$'
Let’s see some validation
>>> person = Person()
>>> try:
... person.validate()
... except ValidationError, e:
... print e.messages
{'name': [u'This field is required.']}
$ pip install schematics
Python 2.7 is supported. 2.6 support is close but test suite needs to be updated.
Using py.test:
$ py.test tests/