Skip to main content

jsonschema-pydantic

Simple transform of jsonschema to pydantic models.

Supported jsonschema features

  • primitive types
  • objects
  • arrays
  • nested objects
  • optional fields
  • default values

Install

pip install jsonschema-pydantic

Usage

from jsonschema_pydantic import jsonschema_to_pydantic

jsonschema = {
    "type": "object",
    "properties": {
        "name": {"type": "string"},
        "age": {"type": "integer"},
    },
    "required": ["name"],
}

pydantic_model = jsonschema_to_pydantic(jsonschema)

Development

Run pytest test suite:

make test

Linting

Run all linters

make lint

Formatting

Format python code:

make fmt

Documentation

Generate documentation:

make docs

Contributions

Read the CONTRIBUTING.md file.

Release files for jsonschema-pydantic 0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jsonschema-pydantic 0.6
File Size Uploaded
jsonschema_pydantic-0.6.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jsonschema-pydantic 0.6
File Interpreter ABI Platform
jsonschema_pydantic-0.6-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / jsonschema_pydantic-0.6.tar.gz

Download URL jsonschema_pydantic-0.6.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6069a8929a333a7c7ea8510e9de50f062e747e655e6ba106da5af1981f995270
BLAKE2b-256 checksum
How to use checksums
d43e088097e87f6b24b162cd42b090b1d3891b68e9dac96ceeac8ed5dff94db7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.1

Release files / jsonschema_pydantic-0.6-py3-none-any.whl

Download URL jsonschema_pydantic-0.6-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98385ed53ab87598665956b43756746350e2b60411a38381231f9703d36e40eb
BLAKE2b-256 checksum
How to use checksums
e767cbb63be985519b51d13499e726db2c960069588d5c2c479859856158b4de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.1

Release history Release notifications | RSS feed

This release

0.6 This release

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page