Skip to main content

schema2model

CI PyPI

Convert JSON Schema dictionaries to Pydantic models.

Installation

pip install schema2model

Usage

from schema2model import schema2model

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

User = schema2model(schema)
user = User(name="Alice", age=30)

Supported Features

  • Basic types: str, int, float, bool
  • Collections: list, set, tuple, dict
  • Date/time: datetime, date, time, timedelta
  • Special types: UUID, bytes, AnyHttpUrl
  • Nested models and enums
  • Recursive models
  • RootModel
  • Discriminated unions
  • Field constraints (gt, lt, min_length, pattern, etc.)
  • Field metadata (description, examples, deprecated)

Metadata

Release files for schema2model 0.1.1

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

Source distribution (sdist)

Source distribution for schema2model 0.1.1
File Size Uploaded Provenance Actions
schema2model-0.1.1.tar.gz 5.9 kB With provenance Details for schema2model-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for schema2model 0.1.1
File Interpreter ABI Platform Actions
schema2model-0.1.1-py3-none-any.whl Python 3 none any Details for schema2model-0.1.1-py3-none-any.whl

Total release size: 11.0 kB

Release files / schema2model-0.1.1.tar.gz

Download URL schema2model-0.1.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fd03805e4265219d409954515c48ad8643937a31ea8b22595df72e1298b8bf52
BLAKE2b-256 checksum
How to use checksums
14690d9ec12e0f6fb45d4014809ef77f74d43fbaaffdfb4ca021b054e553387c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2025.

Transparency log

Release files / schema2model-0.1.1-py3-none-any.whl

Download URL schema2model-0.1.1-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d29f8831fdaa53778e60d5eda1e56456dbf0b489ebc8da341672da06b52ba9cf
BLAKE2b-256 checksum
How to use checksums
febb3b7736ba7c92e86b09f3c5c8c2e4d9748de6ca37f2b3707a8f380e8fe8fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2025.

Transparency log

Security for schema2model 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for schema2model-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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