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.5.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

typedmodel-0.2.5-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: typedmodel-0.2.5.tar.gz
  • Upload date:
  • Size: 3.5 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.5.tar.gz
Algorithm Hash digest
SHA256 0a248c9cbaf06c820687d120be995f16ba318d09d0d4758a755f9155132bd9cd
MD5 ae99c69672d1f816649be8acf68f54b0
BLAKE2b-256 e496278b361737b401ad7b32f0e0397f192000624b7dee1edc816d9431a41b6c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: typedmodel-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 4.3 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 615057e12eced9b304781a989619039af21c1882c144fa8dd71d26bf0c912911
MD5 a0668891d19bc2114c2313671dd778fe
BLAKE2b-256 2c6a91f9e991aa6e942c2bdc13237a210d6ef7899c3798f3e7475e55e69ae660

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