> Every page of the ganymede website is listed in https://eugo.io/docs/ganymede/llms.txt.

# Jsonschema

> jsonschema is an implementation of the JSON Schema specification for Python. A Python demo notebook from ganymede.

Web page: https://eugo.io/docs/ganymede/demo_notebooks/data_structures/jsonschema/
Notebook: https://eugo.io/docs/ganymede/demo_notebooks/data_structures/jsonschema/jsonschema.ipynb (source: https://github.com/eugo-inc/ganymede/blob/main/demo_notebooks/data_structures/jsonschema.ipynb)

Description:
- jsonschema is an implementation of the JSON Schema specification for Python.

Resources:
- [GitHub] https://github.com/python-jsonschema/jsonschema
- [GitHub Jsonschema specifications] https://github.com/python-jsonschema/jsonschema-specifications

Source and license:
- Some of these examples are adapted from the jsonschema README (https://github.com/python-jsonschema/jsonschema), Copyright (c) 2013 Julian Berman, licensed under MIT. That code stays under its own license; see [THIRD_PARTY_NOTICES.md](https://github.com/eugo-inc/ganymede/blob/main/THIRD_PARTY_NOTICES.md).

## Example 1

Validate a schema

```python
from jsonschema 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.
# This is valid
validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema)

# This is invalid
validate(
    instance={"name" : "Eggs", "price" : "Invalid"}, schema=schema,
)
```
