Metadata-Version: 2.0
Name: ciri
Version: 0.6.0
Summary: Python Schema Library
Home-page: https://github.com/ericb/ciri
Author: Eric Bobbitt
Author-email: eric@hellouser.net
License: MIT
Project-URL: Documentation, https://ciri.hellouser.net
Project-URL: Source, https://github.com/ericb/ciri
Project-URL: Tracker, https://github.com/ericb/ciri/issues
Keywords: schema serialization deserialization serialize deserialize encode decode validation validate rest api
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Requires-Python: >=2.6

****
Ciri
****

Ciri helps you build schema definitions for your application; giving you a foundation to perform validation, serialization and encoding. 

Features
========

* Python 3/2 support
* Serialize data to basic Python types 
* Deserialize data back to schema objects
* Schema encoding
* Polymorphic schemas
* Composable Fields
* Controllable error handling
* Pre/post processors available on fields
* Simple API


Install
=======

::

    $ pip install ciri


Documentation
=============

Documentation can be found at http://ciri.hellouser.net/ .

Example
=======

.. code-block:: python

    import datetime

    from ciri import fields, Schema, ValidationError


    class Actor(Schema):

        first_name = fields.String()
        last_name = fields.String()


    class Movie(Schema):

        title = fields.String()
        released = fields.Date()
        cast = fields.List(Actor())


    movie = Movie()
    output = movie.serialize({'title': 'Good Will Hunting',
                               'released': datetime.date(1998, 1, 9),
                               'cast': [
                                   {'first_name': 'Matt', 'last_name': 'Damon'},
                                   {'first_name': 'Ben', 'last_name': 'Affleck'},
                                   {'first_name': 'Robin', 'last_name': 'Williams'}
                               ]})

    # output:
    # {'cast': [{'last_name': 'Damon', 'first_name': 'Matt'},
    #           {'last_name': 'Affleck', 'first_name': 'Ben'},
    #           {'last_name': 'Williams', 'first_name': 'Robin'}],
    #  'released': '1998-01-09',
    #  'title': 'Good Will Hunting'}


