Skip to content

hakenkje/schematics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'Joe Strummer'})
>>> person.name
u'Joe Strummer'

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

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%