From fb5ea74bba210cce034a7ae8bc63b1e81a252fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joscha=20G=C3=B6tzer?= Date: Wed, 28 Oct 2020 11:18:38 +0100 Subject: [PATCH] Update datamodel_code_generator.md (#2058) --- docs/datamodel_code_generator.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/datamodel_code_generator.md b/docs/datamodel_code_generator.md index d96a11c..dec9cbc 100644 --- a/docs/datamodel_code_generator.md +++ b/docs/datamodel_code_generator.md @@ -1,18 +1,18 @@ -[datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator/) is a command to generate pydantic models from other data types. +The [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator/) project is a library and command-line utility to generate pydantic models from just about any data source, including: +* OpenAPI 3 (YAML/JSON) +* JSON Schema +* JSON/YAML Data (which will converted to JSON Schema) -* Supported source types - * OpenAPI 3 (YAML/JSON) - * JSON Schema - * JSON/YAML Data (It will be converted to JSON Schema) +Whenever you find yourself with any data convertible JSON but without pydantic models, this tool will allow you to generate type-safe model hierarchies on demand. -## Install +## Installation ```bash pip install datamodel-code-generator ``` ## Example -In this case, The datamodel-code-generator creates pydantic models from JSON Schema. +In this case, datamodel-code-generator creates pydantic models from a JSON Schema file. ```bash datamodel-codegen --input person.json --input-file-type jsonschema --output model.py ```