pydantic-schema-sync
Synchronise Pydantic model schemas with JSONSchema files.
Usage
CLI
usage: model-schema-sync [-h] [--model MODEL] [--schema_path SCHEMA_PATH]
[--mjs_kwargs MJS_KWARGS]
Config for syncing Pydantic model schemas to disk.
options:
-h, --help show this help message and exit
--model MODEL Dotted import path to the Pydantic model
--schema_path SCHEMA_PATH
File path to save the schema at
--mjs_kwargs MJS_KWARGS
Kwargs to pass `.model_json_schema()`
To serialise the schema of the model named SyncCLI (in the package pydantic_schema_sync's cli module)
to the file schema.json, passing the by_alias=False param to .model_json_schema():
model-schema-sync \
--model pydantic_schema_sync.cli.SyncCLI \
--schema_path schema.json \
--mjs_kwargs '{"by_alias": false}'
Python
From a model class:
from pydantic_schema_sync import sync_schema
# Using field alias (default)
sync_schema(model=Foo, schema_path="schema.json")
# Unaliased field
sync_schema(model=Foo, schema_path="schema.json", mjs_kwargs={"by_alias": False})
From a path to a model class:
from pydantic_schema_sync import sync_schema_from_path
# This path must be in an installed package
path_to_model_cls = "pydantic_schema_sync.cli.SyncCLI"
sync_schema_from_path(model=path_to_model_cls, schema_path="schema.json")
Metadata
Release files for pydantic-schema-sync 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydantic_schema_sync-0.1.5.tar.gz | 2.8 kB | Without provenance | Details for pydantic_schema_sync-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydantic_schema_sync-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for pydantic_schema_sync-0.1.5-py3-none-any.whl |
Total release size: 6.2 kB
Release files / pydantic_schema_sync-0.1.5.tar.gz
| Download URL | pydantic_schema_sync-0.1.5.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3bbf533c701caa76df1653a157948ef04812edac5967b96a54cd4669f0d310d9
|
|
BLAKE2b-256 checksum How to use checksums |
50ec5d2e28afa43184ae50d7f7a6a986e95db4acd672b81dd2f30a6cc992cdef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.18.1 CPython/3.10.14 Linux/5.15.0-117-generic
|
Release files / pydantic_schema_sync-0.1.5-py3-none-any.whl
| Download URL | pydantic_schema_sync-0.1.5-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
049ef26c07238a0703ae568d4eb56e7141addb44875bf4ddd7951fbe5b4c18fd
|
|
BLAKE2b-256 checksum How to use checksums |
c0544642738c3dd5b52e78e9098ef127bab6c699423870e72bc87636a2720aee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.18.1 CPython/3.10.14 Linux/5.15.0-117-generic
|
Security for pydantic-schema-sync 0.1.5
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.