A package for validating json according to a json schema, and type parsing it to python types.
Project description
jschema
This package is handling json schema validation and parsing. It is capable of validating jsons according to schemas, but also it is capable of parsing a json into a python object with pythonic types according to the schema.
Features
- Json schema validation
- Json parsing according to a json schema
Installation
$ pip install jschema
Examples
>>> from pyjschema import loads
>>> json = '{"uuid": "9449771f-56ca-44c7-b9f6-d20315a2c6e0"}'
>>> # Setting up a property "uuid" to be of format "uuid"
>>> schema = {
... 'type': 'object',
... 'properties': {'uuid': {'type': 'string', 'format': 'uuid'}}
... }
>>> loads(json, schema)
{'uuid': UUID('3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a')}
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
pyjschema-1.0.3.tar.gz
(7.7 kB
view hashes)
Built Distribution
Close
Hashes for pyjschema-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91b20ea4ea99afff6934a3eec790c02b7be434e34abcc3a27474ba20bf2cc3d7 |
|
MD5 | ff910ad82056a873d6957059a8587dad |
|
BLAKE2b-256 | 8f1fdb9456c352a2e8cd138fec16a094a8f12397ea5bcd7388c10344b79bacf3 |