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.
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.3.0.tar.gz
(9.9 kB
view details)
Built Distribution
momoa-0.3.0-py3-none-any.whl
(6.0 kB
view details)
File details
Details for the file momoa-0.3.0.tar.gz
.
File metadata
- Download URL: momoa-0.3.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.14.0 CPython/3.11.7 Linux/5.15.0-92-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a292450b664e3494dd944042dcc282c65a3cfe940ef29f37af17a1abcd169195 |
|
MD5 | c3ed0b4a9ca5b2c746ac0a5c8c56f7b3 |
|
BLAKE2b-256 | f441adbefd5b96aa5851200f5e911ee1703b5b608dae9449735904904f7f7628 |
File details
Details for the file momoa-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: momoa-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.14.0 CPython/3.11.7 Linux/5.15.0-92-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | caf4e776ed482c5cfa09ff9349eec1fb3b58ffac9e1a654b326a163f667a3a67 |
|
MD5 | 371623ed570a7bfda2975613dd0b2107 |
|
BLAKE2b-256 | 77cd269dacd95ce896ad6b37e2ba0ee6887d3a1cdfa805f60be0eda81f2d2ca8 |