Skip to main content

A simple library for creating models for JSON objects.

Project description

MangoEngine is a simple library for creating models for JSON objects. Its interface is inspired by the fantastic [MongoEngine](http://mongoengine.org/) library, it resides (basically) in the public domain, and it has no dependencies.

from mangoengine import *

class City(Model):
    name = StringField()
    officials = DictField(
        of_key = StringField(),
        of_value = ListField(of = StringField(), nullable = True)
    )

city = City(name = "Gotham")
city.officials = {
    "mayor": ["Theodore Cobblepot"],
    "batman": ["Bruce Wayne"],
    "citizens": ["Joe Schmoe", "Dick", "Jane"]
}
city.validate()

Project details


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