O!My Models (omymodels) is a library to generate Pydantic, Dataclasses, GinoORM Models, SqlAlchemy ORM, SqlAlchemy Core Table, Models from SQL DDL. And convert one models to another.
v0.12.0
no_auto_snake_case=True
and O!MyModels will do nothing with the table or column names.v0.11.1
v0.11.0
common
module renamed to from_ddl
, but anyway please use public API as imports from main module:from omymodels import create_models
or from omymodels import convert_models
from omymodels import convert_models
models_from = """
class MaterialType(str, Enum):
article = "article"
video = "video"
@dataclass
class Material:
id: int
title: str
description: str
link: str
type: MaterialType
additional_properties: Union[dict, list]
created_at: datetime.datetime
updated_at: datetime.datetime
"""
result = convert_models(models_from, models_type="gino")
print(result)
where models_type
- type of models that you want to get as a result