Metadata-Version: 2.4
Name: validatejsonschema
Version: 0.1.0
Summary: An implementation of JSON Schema validation for Python
Author-email: Jenna Peterson <jennapeterson24@protonmail.com>
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# validatejsonschema

`validatejsonschema` is an implementation of the [JSON Schema](https://json-schema.org) specification for Python.

```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`](https://github.com/python-jsonschema/check-jsonschema).

---

## Features

- Full support for:
  - Draft 2020-12  
    https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft202012Validator
  - Draft 2019-09  
    https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft201909Validator
  - Draft 7  
    https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft7Validator
  - Draft 6  
    https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft6Validator
  - Draft 4  
    https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft4Validator
  - Draft 3  
    https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft3Validator

- Lazy validation that can report all validation errors:  
  https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/protocols/#jsonschema.protocols.Validator.iter_errors

- Programmatic querying of failed validation:  
  https://python-jsonschema.readthedocs.io/en/latest/errors/

---

## Installation

`validatejsonschema` is available on PyPI:

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

Install via pip:

```bash
pip install validatejsonschema
```

---
