Skip to main content

MangoEngine is a lightweight library for creating generic data models in Python.

Project description

MangoEngine is a lightweight library for creating generic data models in Python.

class City(Model):
    name = StringField()
    officials = DictField(
        of_key = StringField(),
        of_value = StringField()
    )
    population = IntegerField(bounds = (0, None))

The models you create with MangoEngine are self-documenting and simple to create. Even better, you can populate them from unreliable sources and validate them to ensure your data is sane.

>>> city = City.from_dict({
...     "name": 12,
...     "officials": {1: 2},
...     "population": "alot"
... })
>>> city.validate()
ValidationError: For field 'name': expecting instance of basestring, got int.

You can leverage this library to create your own light-weight ORM for your application regardless of what your backing store is, without abstracting away important details like queries.

How do I use it?

You can install MangoEngine using pip by running pip install mangoengine.

For references and tutorials, see our documentation on ReadTheDocs.

About the Project

This library started as a means to create models for JSON objects, but has since evolved into a more general purpose library. Its interface is inspired by the fantastic MongoEngine library (thus its name). It was created by John Sullivan and he would greatly appreciate any contributions.

Licensing

All code and literature within this repository is dedicated to the public domain per the terms of the Unlicense.

Project details


Release history Release notifications

History Node

0.1-rc.1

This version
History Node

v1.0.0-rc.2

History Node

v1.0.0-rc.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
MangoEngine-v1.0.0_rc.2-py2.7.egg (27.5 kB) Copy SHA256 hash SHA256 Egg 2.7 Jan 8, 2014
MangoEngine-v1.0.0-rc.2.tar.gz (9.7 kB) Copy SHA256 hash SHA256 Source None Jan 8, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page