Skip to main content

Runtime type checker

Project description

⚡ Strongpy

Version License Downloads

A simple runtime type checker for Python functions.

It validates function arguments and return values using type annotations.


🚀 Features

  • Runtime type checking for function arguments
  • Return type validation
  • Supports modern Python typing:
    • list[T]
    • dict[K, V]
    • tuple
    • set, frozenset
    • Union (|)
    • Literal

📦 Installation

pip install strongpy

or (using uv)

uv add strongpy

🧪 Usage

from strongpy import strong

@strong
def add(x: int, y: int) -> int:
    return x + y

print(add(1, 2))   # OK
print(add("1", 2)) # TypeError

💥 Example error

add argument 'x' expected int, got str

🧠 Supported types

  • int, str, float, bool
  • list[T]
  • dict[K, V]
  • tuple[T, ...]
  • set[T]
  • frozenset[T]
  • Union (int | str)
  • Literal

⚙️ Philosophy

Strong is designed to be:

  • simple
  • explicit
  • predictable

No magic, no runtime inference — only annotations.


🐍 Requirements

Python 3.13+


📌 License

MIT

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

strongpy-0.1.4.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strongpy-0.1.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file strongpy-0.1.4.tar.gz.

File metadata

  • Download URL: strongpy-0.1.4.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for strongpy-0.1.4.tar.gz
Algorithm Hash digest
SHA256 68ecd5cdb5fe04f141507b3834c29e09e5b5eeab5711962079d5fb85f49df2d4
MD5 cccec7b7e0c61611872c9c0c19640310
BLAKE2b-256 c50c975a36eb9b8fea9858e82916ed79326737a914b005310253915d48192eb8

See more details on using hashes here.

File details

Details for the file strongpy-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: strongpy-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for strongpy-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ab6b819084f7202b57bbd867cc0e68cdd66d566dfc6b4c7daac10b19bf37ede6
MD5 b96c01ba71aa70c27dbb48978094773f
BLAKE2b-256 a20eca662fac34773b3c5c837052bf2fed77632796fec6a167a7ebd358f143cc

See more details on using hashes here.

Supported by

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