Skip to main content

Standalone data modeling and validation Python library

Project description

Booby: data modeling and validation library

https://secure.travis-ci.org/jaimegildesagredo/booby.png?branch=master

Booby is a standalone data modeling and validation library written in Python. Booby is under active development and licensed under the Apache2 license, so feel free to contribute and report errors and suggestions.

See the sample code below to get an idea of the main features.

from booby import *

class Token(Model):
    key = StringField()
    secret = StringField()

class User(Model):
    login = StringField(required=True)
    name = StringField()
    email = EmailField()
    token = EmbeddedField(Token, required=True)

jack = User(
    login=u'jacko',
    name=u'Jack',
    email=u'jack@example.com',
    token={
        'key': u'vs7df...',
        'secret': u'ds5ds4...'
    }
)

try:
    jack.validate()
except ValidationError:
    pass
else:
    print jack.to_json()

'{"email": "jack@example.com", "login": "jacko", "token": {"secret": "ds5ds4...", "key": "vs7df..."}, "name": "Jack"}'

Installation

You can install the last stable release of Booby from PyPI using pip or easy_install.

$ pip install booby

Also you can install the latest sources from Github.

$ pip install -e git+git://github.com/jaimegildesagredo/booby.git#egg=booby

Tests

To run the Booby test suite you should install the development requirements and then run nosetests.

$ pip install -r requirements-devel.txt
$ nosetests tests/unit
$ nosetests tests/integration

Documentation

Booby docs are hosted on Read The Docs.

Project details


Release history Release notifications

History Node

0.7.0

History Node

0.6.0

History Node

0.5.2

History Node

0.5.1

History Node

0.5.0

History Node

0.4.0

History Node

0.3.0

History Node

0.2.3

History Node

0.2.2

This version
History Node

0.2.1

History Node

0.2

History Node

0.1.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
booby-0.2.1.tar.gz (5.9 kB) Copy SHA256 hash SHA256 Source None Jan 16, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page