Skip to content

Latest commit

 

History

History
75 lines (56 loc) · 1.89 KB

README.rst

File metadata and controls

75 lines (56 loc) · 1.89 KB

Schematics

Python Data Structures for Humans™.

Build Status

Show me the Code!

>>> 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.']}

Installation

$ pip install schematics

Python 2.7 is supported. 2.6 support is close but test suite needs to be updated.

Documentation

schematics.readthedocs.org

Tests

Using py.test:

$ py.test tests/

Authors