Skip to content

Installation

Pydantic JSON Schema is available on PyPI as pydantic-jsonschema, so installation is as simple as:

uv add pydantic-jsonschema
pip install pydantic-jsonschema

(Requires Python 3.12+)

This installs the pydantic_jsonschema package, plus the core dependencies required to create and validate generated models:

  • pydantic for model creation and validation.
  • openapi-pydantic for JSON Schema types such as Schema, Reference, and DataType.

Optional dependencies

Pydantic JSON Schema has optional dependencies for format validation.

Use formats-base for standard JSON Schema formats such as email, hostname, URI, and IRI:

uv add 'pydantic-jsonschema[formats-base]'
pip install 'pydantic-jsonschema[formats-base]'

Use formats-extra for domain-specific formats such as payment cards, phone numbers, colors, country codes, and MAC addresses:

uv add 'pydantic-jsonschema[formats-extra]'
pip install 'pydantic-jsonschema[formats-extra]'

To install both groups:

uv add 'pydantic-jsonschema[formats-all]'
pip install 'pydantic-jsonschema[formats-all]'

See Format Validators for supported formats and usage examples.

Install from repository

If you prefer to install directly from a repository checkout:

uv add 'git+https://github.com/Danipulok/pydantic-jsonschema@main'
pip install 'git+https://github.com/Danipulok/pydantic-jsonschema@main'

For local development, use the contributing guide instead. It is the source of truth for development dependencies, just recipes, documentation checks, and PR workflow.

Next Steps