Skip to main content

A converter from JSONSchema to Pydantic classes

Project description

JSONSchema Converter

JSONSchema Converter is a tool that performs conversions from a json-schema file to pydantic classes

installation

pip install jsonschema-converter

requirements

pydantic>=2.5.3 loguru>=0.7.1

usage

script main.py

from jsonschema_converter.main_parser import parse_json_schema
from jsonschema_converter.utils import parse_args

if __name__ == "__main__":
    file_name, module_name = parse_args()
    parse_json_schema(file_name, module_name)

CLI

python main.py --file_name myjsonschema.json --module_name schemas

examples

you can find examples of jsonschema input and pydantic classes output in the examples folder

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonschema_converter-0.1.8.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

jsonschema_converter-0.1.8-py3-none-any.whl (9.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page