Skip to main content

create efficent models starting from json schema

Project description

Usage

With the schema in types/schema.yaml

$schema: http://json-schema.org/schema#
properties:
  name:
    type: string
  surname:
    type: string
  age:
    type: integer
required:
  - name
  - surname
  - age

you can load a model with automatic validation and efficent use of __slots__

import yaml
import modeler

schema = yaml.load(open('types/schema.yaml').read())

Model = modeler.make_model(schema=schema,)

Model(name='Tommaso', surname='De Rossi', age=19)

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

modeller-0.0.5.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

modeller-0.0.5-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

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