Skip to main content

An implementation of JSON Schema validation for Python

Project description

validatejsonschema

validatejsonschema is an implementation of the JSON Schema specification for Python.

from validatejsonschema import validate

# A sample schema, like what we'd get from json.load()
schema = {
    "type": "object",
    "properties": {
        "price": {"type": "number"},
        "name": {"type": "string"},
    },
}

# If no exception is raised by validate(), the instance is valid.
validate(instance={"name": "Eggs", "price": 34.99}, schema=schema)

validate(
    instance={"name": "Eggs", "price": "Invalid"}, schema=schema,
)
# Raises:
# ValidationError: 'Invalid' is not of type 'number'

It can also be used from the command line by installing
check-jsonschema.


Features


Installation

validatejsonschema is available on PyPI:

https://pypi.org/project/validatejsonschema/

Install via pip:

pip install validatejsonschema

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

validatejsonschema-0.1.0-cp312-cp312-win_amd64.whl (500.5 kB view details)

Uploaded CPython 3.12Windows x86-64

File details

Details for the file validatejsonschema-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for validatejsonschema-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f534f9f4449bcfed411067bd457b8a5103f73e4251da3159cd1b03c0a381f6c3
MD5 4e7b5e9878debcfca8d612c05d7fa8d4
BLAKE2b-256 d11a848c334b44edb7df5d4a085563d35dc5bfd9f2eec3ffa16df843111bb485

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page