Skip to main content

Lightweight Marshalling of Python 3 Objects.

Project description

PyPi Package Documentation Status Build Status Test Coverage

lima takes arbitrary Python objects and converts them into data structures native to Python. The result can easily be serialized into JSON, XML, and all sorts of other things. lima is Free Software, lightweight and fast.

lima at a Glance

import datetime
import lima

# a model
class Book:
    def __init__(self, title, date_published):
        self.title = title
        self.date_published = date_published

# a marshalling schema
class BookSchema(lima.Schema):
    title = lima.fields.String()
    published = lima.fields.Date(attr='date_published')

book = Book('The Old Man and the Sea',, 9, 1))
schema = BookSchema()
# {'published': '1952-09-01', 'title': 'The Old Man and the Sea'}

Key Features

lima has only a few hundred SLOC. lima has no external dependencies.
lima tries to be as fast as possible while still remaining pure Python 3.
Well documented
lima has a comprehensive tutorial and more than one line of docstring per line of Python code (see documentation).
lima is Free Software, licensed under the terms of the MIT license.


Python 3.3 or newer. That’s it.


$ pip install lima

See the documentation for more comprehensive install instructions.

Project details

Download files

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

Source Distribution

lima-0.5.tar.gz (24.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page