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

Release files for avocato 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for avocato 0.1.0
File Size Uploaded
avocato-0.1.0.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for avocato 0.1.0
File Interpreter ABI Platform
avocato-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / avocato-0.1.0.tar.gz

Download URL avocato-0.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9bcf495bd8cf33182bcaf4cd4e853eb29335f4286665bcd812d4c2e71cce257e
BLAKE2b-256 checksum
How to use checksums
70b631f436e10a2a3a7c66dac4e8cd76a3e54f0a2c8e826f3f79ce712107fc0b
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / avocato-0.1.0-py3-none-any.whl

Download URL avocato-0.1.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3befc7626230ebad06a05a8797daff085b032b6c4f2132d842e8a0c23a8a7b88
BLAKE2b-256 checksum
How to use checksums
a393ed1789c99d90d1e761e5113db837ee70f5ffaf598eb8b281880b54494f22
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page