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', datetime.date(1952, 9, 1))
schema = BookSchema()
schema.dump(book)
# {'published': '1952-09-01', 'title': 'The Old Man and the Sea'}

Key Features

Lightweight

lima has only a few hundred SLOC. lima has no external dependencies.

Fast

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).

Free

lima is Free Software, licensed under the terms of the MIT license.

Requirements

Python 3.3 or newer. That’s it.

Installation

$ 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 details)

Uploaded Source

File details

Details for the file lima-0.5.tar.gz.

File metadata

  • Download URL: lima-0.5.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lima-0.5.tar.gz
Algorithm Hash digest
SHA256 3b10419b364633e3eda52c398b120c547fd9d5854e4cefd9bcf79c3c0a001263
MD5 21a660858a516a83bf74d17a6416d763
BLAKE2b-256 6e2821c28adcd88cb607f33aa6be8794861da0db089058183e62cfe053d68fe0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page