Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Transform dictionaries into Python objects

Project Description

Easily create Python objects from dictionaries- basically an ORM that can work with any type of database. Usage example:

from cargo.spec import Spec, unpack
from cargo.fields import Field

class Model(Spec):
    name    = Field(str).With.length(6)
    version = Field(tuple).where.each.Is.An(int)

unpack(Model, {

Nested unpacking is currently supported but the library assumes that you are passing in objects of a reasonable depth (i.e. not recursive) and therefore does not cache the seen values.

cargo is still work in progress and it’s API may change either completeley or partially, or the internal functionality modified without any notice at any given point in time.

You can now get this package easily by installing the latest release from the Python Package Index, something like the following:

$ pip install cargo

If you want to run the test suites or contribute some code you need to install a library called Requires via pip, i.e. which will make the tests run:

$ pip install Requires
$ git clone ssh://
$ python cargo/

Release History

This version
History Node


History Node


History Node


Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers