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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: typedmodel-0.2.7.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.7.tar.gz
Algorithm Hash digest
SHA256 3ae32e353a206b9f3ce99bb18ee99a9c8686119d7bba248a432ab553752a5d6f
MD5 99b82cc88aa8962323a8ff9500f8355c
BLAKE2b-256 8b6e356266c3f086edee29963ddc9e243ddaf0adf7cb4e3b2d7cf48a88132acd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: typedmodel-0.2.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8c7ce33450ac775287cafc9466315c309e0ca3b2d86f7c1334deffb831b240f2
MD5 19a8686eabbda707f3e2f09c602f2fbb
BLAKE2b-256 63ab7c2e0f59d65a7fa31623a4d4e1bb32a0abb98b76441d002e1d2a7aacafd6

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