Skip to main content

A library for definition, validation and serialisation of Python objects based on JSONSchema specifications.

Project description

Momoa

A library for definition, validation and serialisation of models based on JSON Schema specifications.

Documentation Status Build Status

Basic Usage

from datetime import datetime
from momoa import Schema
from momoa.model import UNDEFINED

schema = Schema.from_uri("file://path/to/schema.json")
PersonModel = schema.model

birthday = datetime(1969, 11, 23)
person = PersonModel(firstName="Boris", lastName="Harrison", birthday=birthday)

assert person.age is UNDEFINED
assert person.birthday is UNDEFINED

person.age = 53
person.birthday = datetime(1969, 11, 23)

assert person.age == 53
assert person.birthday == datetime(1969, 11, 23)

Compatibility

For validating schemas Momoa depends on Statham, which supports the JSON Schema Draft 6 specification.

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

momoa-0.2.3.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

momoa-0.2.3-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file momoa-0.2.3.tar.gz.

File metadata

  • Download URL: momoa-0.2.3.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.14.0 CPython/3.8.10 Linux/5.15.0-92-generic

File hashes

Hashes for momoa-0.2.3.tar.gz
Algorithm Hash digest
SHA256 5c6b1149821114df5e8d7485746b964df832f1ec19e32f4f80d0dd3ac48fc223
MD5 0c302efbdb9e1ccbbf1f5b42acb5e90a
BLAKE2b-256 4726327564787eb63a4e4131363023e8f22c02bf464759ae25524eac039c6464

See more details on using hashes here.

File details

Details for the file momoa-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: momoa-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.14.0 CPython/3.8.10 Linux/5.15.0-92-generic

File hashes

Hashes for momoa-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 51fc28b6d45fcd2704b16eb54c322c4e5db39652fb91a1143ee34e4694adc01c
MD5 353172da5b23ac5edef6e7438a07a017
BLAKE2b-256 c0a24c7a59d06c7776a060da9c147166713efcfa580c261ac29986227ba75152

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