Metadata-Version: 1.1
Name: booby
Version: 0.4.0
Summary: Data modeling and validation Python library
Home-page: https://github.com/jaimegildesagredo/booby
Author: Jaime Gil de Sagredo Luna
Author-email: jaimegildesagredo@gmail.com
License: UNKNOWN
Description: Booby: data modeling and validation
        ===================================
        
        .. image:: https://secure.travis-ci.org/jaimegildesagredo/booby.png?branch=master
            :target: http://travis-ci.org/jaimegildesagredo/booby
        
        Booby is a standalone data `modeling` and `validation` library written in Python. Booby is under active development and licensed under the `Apache2 license <http://www.apache.org/licenses/LICENSE-2.0.html>`_, so feel free to `contribute <https://github.com/jaimegildesagredo/booby/pulls>`_ and `report errors and suggestions <https://github.com/jaimegildesagredo/booby/issues>`_.
        
        See the sample code below to get an idea of the main features.
        
        .. code-block:: python
        
            from booby import Model, fields
        
            class Token(Model):
                key = fields.String()
                secret = fields.String()
        
            class User(Model):
                login = fields.String(required=True)
                name = fields.String()
                email = fields.Email()
                token = fields.Embedded(Token, required=True)
                addresses = fields.Field(default=list)
        
            class Address(Model):
                line_1 = fields.String(required=True)
                line_2 = fields.String()
        
            jack = User(
                login='jack',
                name='Jack',
                email='jack@example.com',
                token={
                    'key': 'vs7dfxxx',
                    'secret': 'ds5ds4xxx'
                },
                addresses=[
                    Address(line_1='Main Street'),
                    Address(line_1='Main St')
                ]
            )
        
            if jack.is_valid:
                print jack.to_json(indent=2)
            else:
                print json.dumps(dict(jack.validation_errors))
        
        .. code-block:: json
        
            {
              "email": "jack@example.com",
              "login": "jack",
              "token": {
                "secret": "ds5ds4xxx",
                "key": "vs7dfxxx"
              },
              "name": "Jack",
              "addresses": [
                {
                  "line_1": "Main St",
                  "line_2": null
                },
                {
                  "line_1": "Main Street",
                  "line_2": null
                }
              ]
            }
        
        Installation
        ------------
        
        You can install the last stable release of Booby from PyPI using pip or easy_install.
        
        .. code-block:: bash
        
            $ pip install booby
        
        Also you can install the latest sources from Github.
        
        .. code-block:: bash
        
            $ 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.
        
        .. code-block:: bash
        
            $ pip install -r requirements-devel.txt
            $ nosetests tests/unit
            $ nosetests tests/integration
        
        Changes
        -------
        
        See `Changes <https://booby.readthedocs.org/en/latest/changes.html>`_.
        
        Documentation
        -------------
        
        Booby docs are hosted on `Read The Docs <https://booby.readthedocs.org>`_.
        
        
        Changes
        =======
        
        0.4.0 (Ago 4, 2013)
        -------------------
        
        Backwards-incompatible
        ^^^^^^^^^^^^^^^^^^^^^^
        
        * Moved the `Model.to_dict` functionality to `dict(model)`.
        * The `Model.validation_errors` method now is an interable of field name and validaton error pairs.
        * Removed the `Field` subfix for all Booby fields. Now use the module as namespace: `fields.String`.
        
        Highlights
        ^^^^^^^^^^
        
        * Added an `is_valid` property to `Model`.
        * The `Model` instances now are iterables of field name, value pairs.
        
        0.3.0 (Jun 20, 2013)
        --------------------
        
        Highlights
        ^^^^^^^^^^
        
        * When passed a `callable` object as a field `default` then the default value for this field in a model instance will be the return value of the given callable.
        
        * Added the :func:`models.Model.validation_errors` method to get a dict of field name and error message pairs for all invalid model fields.
        
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
