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
pip install typedmodel
from typedmodel import BaseModel
class Foo(BaseModel):
a: str
b: str
d = 'default'
e: str = 'default'
foo = Foo(a="a", b="b")
check tests for more use cases
Release files for typedmodel 0.2.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| typedmodel-0.2.8.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| typedmodel-0.2.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / typedmodel-0.2.8.tar.gz
| Download URL | typedmodel-0.2.8.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
26c9270df032ad515176a06c343fcd7f40e76b341c9fed6095b5da76b466eedf
|
|
BLAKE2b-256 checksum How to use checksums |
c7f0ce930d0fe4e3fa448b10c51c748df2a5284a8a42d4ee0d49d35e6b0be2ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
|
Release files / typedmodel-0.2.8-py3-none-any.whl
| Download URL | typedmodel-0.2.8-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9b18f266b93d767a60fa656db1ba556385edb689d7d671495742ea21ce0c2a1
|
|
BLAKE2b-256 checksum How to use checksums |
9c3a8bb2bb3c03b20b821931dffae2c6d83e401d2f6cfa486e2afdd6480b60d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
|