Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakkusakura/typedmodel
https://github.com/jakkusakura/typedmodel
Last synced: about 6 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/jakkusakura/typedmodel
- Owner: JakkuSakura
- Created: 2021-12-23T15:01:05.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-18T15:09:55.000Z (almost 3 years ago)
- Last Synced: 2024-12-18T02:19:07.104Z (29 days ago)
- Language: Python
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TypedModel
TypedModel aims to provide strict type checking for dataclass and pydantic model.
dataclass is useful, but provides no type checking
pydantic is useful, but sometimes it bugs out
https://github.com/samuelcolvin/pydantic/issues/3189
https://github.com/samuelcolvin/pydantic/issues/3569
## Usage
```shell
pip install typedmodel
``````python3
from typedmodel import BaseModelclass Foo(BaseModel):
a: str
b: str
d = 'default'
e: str = 'default'foo = Foo(a="a", b="b")
```
check `tests` for more use cases