跳转到主要内容

从JSON模式生成Python类的源代码。

项目描述

jschema-to-python

从JSON模式生成Python类。

用法

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)

贡献

本项目欢迎贡献和建议。大多数贡献需要您同意贡献者许可协议(CLA),声明您有权并且实际上授予我们使用您贡献的权利。有关详细信息,请访问https://cla.opensource.microsoft.com

当您提交拉取请求时,CLA机器人将自动确定您是否需要提供CLA,并相应地装饰PR(例如,状态检查,注释)。只需遵循机器人提供的说明即可。您在整个使用我们的CLA的仓库中只需这样做一次。

本项目已采用微软开源行为准则。有关更多信息,请参阅行为准则FAQ或联系opencode@microsoft.com以提出任何额外的问题或评论。

项目详情


下载文件

下载您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分发

jschema_to_python-1.2.3.tar.gz (10.1 kB 查看哈希值)

上传时间: 源代码

构建分发版

jschema_to_python-1.2.3-py3-none-any.whl (10.4 kB 查看哈希值)

上传时间: Python 3

由以下支持