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.
MIT License
Published by xnuinside about 2 years ago
v0.12.1
Published by xnuinside about 2 years ago
v0.12.0
no_auto_snake_case=True
and O!MyModels will do nothing with the table or column names.Published by xnuinside over 2 years ago
v0.11.1
Published by xnuinside almost 3 years ago
v0.11.0
Published by xnuinside about 3 years ago
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
Published by xnuinside about 3 years ago
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
Published by xnuinside over 3 years ago