Metadata-Version: 2.1
Name: avocato
Version: 0.1.0
Summary: Simple and fast object serialization.
Home-page: https://github.com/tsifrer/avocato
Author: Tomaz Sifrer
Author-email: tomazz.sifrer@gmail.com
License: MIT
Keywords: serialization,deserialization,validation,rest,json,api,fast
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
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
Description-Content-Type: text/x-rst
Provides-Extra: django
Requires-Dist: django (>=2.1.5) ; extra == 'django'
Requires-Dist: psycopg2-binary (>=2.7.6.1) ; extra == 'django'
Provides-Extra: peewee
Requires-Dist: peewee (>=3.8.1) ; extra == 'peewee'
Requires-Dist: psycopg2-binary (>=2.7.6.1) ; extra == 'peewee'

*********************************************
avocato: simple and fast object serialization
*********************************************

.. container:: badges

    .. image:: https://travis-ci.org/tsifrer/avocato.svg?branch=master
        :target: https://travis-ci.org/tsifrer/avocato?branch=master
        :alt: Travis-CI

    .. image:: https://readthedocs.org/projects/avocato/badge/?version=latest
        :target: https://avocato.rtfd.io
        :alt: Documentation Status

    .. image:: https://codecov.io/gh/tsifrer/avocato/branch/master/graph/badge.svg
        :target: https://codecov.io/gh/tsifrer/avocato
        :alt: Code Coverage


**avocato** is a simple and fast ORM/framework-agnostic object serialization library for
converting complex objects to and from simple Python datatypes.

Don't be scared if you're using an ORM/framework. It can easily be adapted to be used with any
ORM/framework of your liking. Currently it supports Django ORM and peewee.

This library is heavily influenced by `serpy`_.

Installation
============

.. code-block:: bash

    $ pip install avocato

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

Find documentation at `avocato.rtfd.io`_

Example
=======

.. code-block:: python

    import avocato

    class Bar(object):
        patrick = 'star'


    class Foo(object):
        over = 9000
        spongebob = 'squarepants'
        bar = Bar()


    class BarSerializer(avocato.Serializer):
        patrick = avocato.StrField()


    class FooSerializer(avocato.Serializer):
        over = avocato.IntField()
        spongebob = avocato.StrField()
        bar = BarSerializer()


    foo = Foo()
    FooSerializer(foo).data
    # {'over': 9000, 'spongebob': 'squarepants', 'bar': {'patrick': 'star'}}


.. _serpy: https://github.com/clarkduvall/serpy
.. _avocato.rtfd.io: https://avocato.rtfd.io

