Metadata-Version: 2.1
Name: serde
Version: 0.6.1
Summary: Define, serialize, deserialize, and validate Python data structures.
Home-page: https://github.com/rossmacarthur/serde
Author: Ross MacArthur
Author-email: ross@macarthur.io
License: MIT
Download-URL: https://github.com/rossmacarthur/serde/archive/0.6.1.tar.gz
Project-URL: Documentation, https://ross.macarthur.io/project/serde/
Project-URL: Issue Tracker, https://github.com/rossmacarthur/serde/issues
Keywords: serde serialization deserialization validation schema json
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
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: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
Requires-Dist: isodate (<0.7.0,>=0.6.0)
Requires-Dist: six (<2.0.0,>=1.0.0)
Provides-Extra: cbor
Requires-Dist: cbor2 (<5.0.0,>=4.0.0) ; extra == 'cbor'
Provides-Extra: dev.lint
Requires-Dist: flake8 (>=3.7.0) ; extra == 'dev.lint'
Requires-Dist: flake8-docstrings ; extra == 'dev.lint'
Requires-Dist: flake8-isort ; extra == 'dev.lint'
Requires-Dist: flake8-quotes ; extra == 'dev.lint'
Requires-Dist: pep8-naming ; extra == 'dev.lint'
Provides-Extra: dev.test
Requires-Dist: mock ; extra == 'dev.test'
Requires-Dist: pytest (>=3.6.0) ; extra == 'dev.test'
Requires-Dist: pytest-cov (>=2.6.1) ; extra == 'dev.test'
Requires-Dist: pytest-doctest-import ; extra == 'dev.test'
Provides-Extra: ext
Requires-Dist: serde-ext (<0.2.0,>=0.1.0) ; extra == 'ext'
Provides-Extra: json
Requires-Dist: simplejson (<4.0.0,>=3.0.0) ; extra == 'json'
Provides-Extra: toml
Requires-Dist: toml (<0.11.0,>=0.10.0) ; extra == 'toml'
Provides-Extra: yaml
Requires-Dist: ruamel.yaml (<0.16.0,>=0.15.0) ; extra == 'yaml'

Serde
=====

.. image:: https://img.shields.io/pypi/v/serde.svg?style=flat-square&colorB=4c1
    :target: https://pypi.org/project/serde/
    :alt: PyPI Version

.. image:: https://img.shields.io/badge/docs-passing-brightgreen.svg?style=flat-square
    :target: https://ross.macarthur.io/project/serde/
    :alt: Documentation Status

.. image:: https://img.shields.io/travis/rossmacarthur/serde/master.svg?style=flat-square
    :target: https://travis-ci.org/rossmacarthur/serde
    :alt: Build Status

.. image:: https://img.shields.io/codecov/c/github/rossmacarthur/serde.svg?style=flat-square
    :target: https://codecov.io/gh/rossmacarthur/serde
    :alt: Code Coverage

Serde is a lightweight, general-purpose, powerful ORM framework for defining,
serializing, deserializing, and validating data structures in Python.

Getting started
---------------

Install this package with

::

    pip install serde


Example usage
-------------

Define your data structures in a clean and obvious way.

.. code:: python

    >>> from serde import Model, fields

    >>> class Dog(Model):
    ...     name = fields.Str()
    ...     hates_cats = fields.Optional(fields.Bool, default=True)

    >>> class Owner(Model):
    ...     name = fields.Str()
    ...     birthday = fields.Date()
    ...     dog = fields.Nested(Dog)

Easily serialize and deserialize arbitrary data to and from Python objects.

.. code:: python

    >>> owner = Owner.from_json('''{
    ...     "name": "Paris Hilton",
    ...     "birthday": "1981-02-17",
    ...     "dog": {"name": "Tinkerbell"}
    ... }''')

    >>> owner.name
    'Paris Hilton'
    >>> owner.birthday
    datetime.date(1981, 2, 17)
    >>> owner.dog
    Dog(name='Tinkerbell', hates_cats=True)

View the latest usage and API documentation
`here <https://ross.macarthur.io/project/serde/api.html>`_.

License
-------

This project is licensed under the MIT License.


