Skip to main content

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

$ pip install avocato

Documentation

Find documentation at avocato.rtfd.io

Example

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'}}

Download files

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

Source Distribution

avocato-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

avocato-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file avocato-0.1.0.tar.gz.

File metadata

  • Download URL: avocato-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.0

File hashes

Hashes for avocato-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9bcf495bd8cf33182bcaf4cd4e853eb29335f4286665bcd812d4c2e71cce257e
MD5 8dfeb998b8af3c6e6c1d6c0346af1e59
BLAKE2b-256 70b631f436e10a2a3a7c66dac4e8cd76a3e54f0a2c8e826f3f79ce712107fc0b

See more details on using hashes here.

File details

Details for the file avocato-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: avocato-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.0

File hashes

Hashes for avocato-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3befc7626230ebad06a05a8797daff085b032b6c4f2132d842e8a0c23a8a7b88
MD5 5fe00fd4271f577693635b97a4636fa6
BLAKE2b-256 a393ed1789c99d90d1e761e5113db837ee70f5ffaf598eb8b281880b54494f22

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page