semvec/pypi-packages huggingface dataset:
validatejsonschema 0.1.2
An implementation of JSON Schema validation for Python
License: MIT
Requires Python: >=3.9

# 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).

---

## Installation

`validatejsonschema` is available on PyPI:

https://pypi.org/project/validatejsonschema/

Install via pip:

```bash
pip install validatejsonschema
```

---