Implements sereval JSON specs, like JSON Schema.
Project description
This library implements several JSON specs, like JSON Schema:
It works on python 2.7, python 3.3 and above
It is release under the BSD license
Installation
This library has no special dependencies. You can simply use pip:
$ pip install json-extensions
Usage
Let say you want to validate JSON like objects. You can describe you data with JSON Schema:
from json.schema import load
# data will validate against this schema
validator = load({
'title': 'Example Schema',
'type': 'object',
'properties': {
'age': {
'description': 'Age in years',
'minimum': 0,
'type': 'integer'
},
'firstName': {
'type': 'string'
},
'lastName': {
'type': 'string'
}
},
'required': [
'firstName',
'lastName'
]
})
# validate this data
validator.validate({
'firstName': 'John',
'lastName': 'Noone',
'age': 33,
})
Other examples can be found in the documentation of in the tests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
json-extensions-b76bc7d.tar.gz
(23.0 kB
view details)
File details
Details for the file json-extensions-b76bc7d.tar.gz.
File metadata
- Download URL: json-extensions-b76bc7d.tar.gz
- Upload date:
- Size: 23.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4eb170baf09ba2ed47982e3e84580582cf04deedbd6e3e8ede37d2acfdf02d4b
|
|
| MD5 |
b69d7618991a03d059707154911352d0
|
|
| BLAKE2b-256 |
980afd054f2192cfc15c4ea7e2552b5fdb00e75226bae7274f23c2745f6e83a4
|