Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/microsoft/jschema-to-python
Generate source code for a set of Python classes from a JSON schema.
https://github.com/microsoft/jschema-to-python
code-generator json-schema python
Last synced: 29 days ago
JSON representation
Generate source code for a set of Python classes from a JSON schema.
- Host: GitHub
- URL: https://github.com/microsoft/jschema-to-python
- Owner: microsoft
- License: mit
- Created: 2019-09-17T17:21:25.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-10-25T00:47:26.000Z (about 2 years ago)
- Last Synced: 2024-09-27T08:59:01.395Z (about 1 month ago)
- Topics: code-generator, json-schema, python
- Language: Python
- Size: 48.8 KB
- Stars: 34
- Watchers: 5
- Forks: 17
- Open Issues: 10
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
jschema-to-python
=================Generate Python classes from a JSON schema.
Usage
=====
::python -m jschema_to_python [-h] -s SCHEMA_PATH -o OUTPUT_DIRECTORY [-m MODULE_NAME] -r ROOT_CLASS_NAME [-g HINTS_FILE_PATH] [-f] [-v]
Generate source code for a set of Python classes from a JSON schema.
optional arguments:
-h, --help show this help message and exit
-s SCHEMA_PATH, --schema-path SCHEMA_PATH
path to the JSON schema file
-o OUTPUT_DIRECTORY, --output-directory OUTPUT_DIRECTORY
directory in which the generated classes will be
created
-m MODULE_NAME, --module-name MODULE_NAME
name of the module containing the object model classes
-r ROOT_CLASS_NAME, --root-class-name ROOT_CLASS_NAME
the name of the class at the root of the object model
represented by the schema
-g HINTS_FILE_PATH, --hints-file-path HINTS_FILE_PATH
path to a file containing hints that control code
generation
-f, --force overwrite the output directory if it exists
-v, --verbose increase output verbosity (may be specified up to two
times)Contributing
============This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.This project has adopted the `Microsoft Open Source Code of Conduct `_.
For more information see the `Code of Conduct FAQ `_ or
contact `[email protected] `_ with any additional questions or comments.