Skip to main content

provide strict type checking for dataclass and pydantic model

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

typedmodel-0.2.6.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

typedmodel-0.2.6-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file typedmodel-0.2.6.tar.gz.

File metadata

  • Download URL: typedmodel-0.2.6.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for typedmodel-0.2.6.tar.gz
Algorithm Hash digest
SHA256 ab54fe1d7f00ace0beca6cabb15578a17931f37c4455a223d4a483b78c800ee1
MD5 93c27c8a2f8fefa545c81850f65934da
BLAKE2b-256 6cb487d0702f82d6b6b9bc863f521e52df8e289cbcad7f2c2c2e5e7d0c2586be

See more details on using hashes here.

File details

Details for the file typedmodel-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: typedmodel-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for typedmodel-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 22811c0bdbe3b7e92b2581efec19ff0f6e1bbe67e882abbf5eee9e472f163995
MD5 b39647ff94e72ef5f3b1ff822b4dd04b
BLAKE2b-256 d29fd8a5f8536ec17fb52a185eed4fdb115f658786cbc9ec900dcc0e4ba4713f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page