Skip to main content

Runtime type checker

Project description

⚡ Strong

A lightweight 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 strong

or (using uv)

uv add strong

🧪 Usage

from strong 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
  • lightweight
  • predictable

No magic, no runtime inference — only annotations.


🐍 Requirements

Python 3.10+


📌 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.0.tar.gz (6.4 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.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: strongpy-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 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.0.tar.gz
Algorithm Hash digest
SHA256 ce1ad2cb0301ff80060c82a5675c97ed13ddf4b5ea9ada720a8f4494136059cd
MD5 f554b940b7386b4bcbec7745fcd9afdb
BLAKE2b-256 c87adb94131fbf4e86db953f94b69b34a17c0441d58d32ded4ecd2085c93a834

See more details on using hashes here.

File details

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

File metadata

  • Download URL: strongpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4038dc2e5007fa2b49b8d21a42af30dbaddc0373e2217cb5a2224bdd500a7470
MD5 50a983b448e806671862435fc63d709a
BLAKE2b-256 b322304f0019fcae522eea54b7a251e8c0be944cf7c224b2cbd57fdbbc78a3d8

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