Contents

pydantic-gen generates pydantic schemas from YAML files

0

Code generator for pydantic schemas

pydantic-gen is a code generation python package that takes a YML file containing a OpenAPI Schema and generates python pydantic models. pydantic-gen can get used in your codebase to dynamically regenerate your pydantic models or it can be used one time to generator python code. The author of the pydantic-gen module is Mikhail Beliansky.

Stars: 15, Watchers: 15, Forks: 3, Open Issues: 1

The licht1stein/pydantic-gen repo was created 4 years ago and the last code push was 4 years ago. The project is not very popular with only 15 github stars!

How to Install pydantic-gen

You can install pydantic-gen using pip

pip install pydantic-gen

or add it to a project with poetry

poetry add pydantic-gen

Package Details

Author
MB
License
MIT
Homepage
https://github.com/licht1stein/pydantic-gen
PyPi:
https://pypi.org/project/pydantic-gen/
GitHub Repo:
https://github.com/licht1stein/pydantic-gen

Classifiers

No  pydantic-gen  pypi packages just yet.

Errors

A list of common pydantic-gen errors.

Code Examples

Here are some pydantic-gen code examples and snippets.

Related Packages & Articles

jsonargparse 4.33.2

Implement minimal boilerplate CLIs derived from type hints and parse from command line, config files and environment variables.

fastapi 0.115.0

FastAPI framework, high performance, easy to learn, fast to code, ready for production

typing - Support for type hints

This module provides runtime support for type hints as specified by PEP 484, PEP 526, PEP 544, PEP 586, PEP 589, PEP 591, PEP 612 and PEP 613. The most fundamental support consists of the types Any, Union, Tuple, Callable, TypeVar, and Generic. For full specification please see PEP 484. For a simplified introduction to type hints see PEP 483.

import typing

# preferred
from typing import Dict, List, Union, Any

myvar: Dict = {}
# non-preferred
import typing

myvar: typing.Dict = {}

Code examples


from typing import Mapping, Dict, Any, Union

example1: Dict = {}

example2: Dict[str, Any]

example2: Mapping[str, int]

example3: Union[Dict[str, int], None]

example4: Union[str, None]

def hello(name: str) -> str:
    return f"Hello {name}"

Reference

orjson 3.10.7

Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy