Omymodels

Latest version: v0.17.0

Safety actively analyzes 682387 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 4

0.9.0

Features:
1. Added beta models converter from one type of models to another.
To use models convertor:

python
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

2. Now if O!MyModels does not know how to convert type - he just leave it as is.

Fixes:
1. In Dataclass & Pydantic generators now Decimals & Floats converted to float (previously was int).

0.8.4

1. Now if tables was not found in input DDL - models generator raise NoTable error. if you want to have still silent exit if no tables, please use flag: exit_silent

0.8.3

1. Added fundamental concept of TableMetaModel - class that unifies metadata parsed from different classes/ORM models types/DDLs to one standard to allow easy way convert one models to another
in next releases it will be used for converter from one type of models to another.
2. Fixed issue: https://github.com/xnuinside/omymodels/issues/18 "NOW() not recognized as now()"
3. Fixed issue: https://github.com/xnuinside/omymodels/issues/19 "Default value of now() always returns same time, use field for dataclass"

0.8.1

1. Parser version is updated (fixed several issues with generation)
2. Fixed issue with Unique Constraint after schema in SQLAlchemy Core

0.8.0

1. Fix --defaults-off flag in cli
2. Added support for SQLAlchemy Core Tables generating
3. Added examples folder in github `omymodels/example`
4. Fix issue with ForeignKey in SQLAlchemy

0.7.0

1. Added generation for SQLAlchemy models (defaults from DDLs are setting up as 'server_default')
2. Added defaults for Pydantic models
3. Added flag to generate Pydantic & Dataclass models WITHOUT defaults `defaults_off=True` (by default it is False). And cli flag --defaults-off
4. Fixed issue with Enum types with lower case names in DDLs
5. Fixed several issues with Dataclass generation (default with datetime & Enums)
6. '"' do not remove from defaults now

Page 3 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.