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

usage

main.py

from argparse import ArgumentParser

from jsonschema_converter.parse import parse_json


def main(file_name: str):
    parse_json(file_name)


def parse_args():
    argument_parser = ArgumentParser(
        prog="JsonSchema2Pydantic",
        description="creates classes from json_schema file"
    )
    argument_parser.add_argument("file_name")
    args = argument_parser.parse_args()
    return args.file_name


if __name__ == "__main__":
    main(parse_args())
python main.py myjsonschema.json

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.3.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

jsonschema_converter-0.1.3-py3-none-any.whl (7.6 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