Skip to main content

Runtime type checker

Project description

⚡ strongpy

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 strongpy

or (using uv)

uv add strongpy

🧪 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.2.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.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: strongpy-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 00889fccc17bc604a60a17e306dcbff18dc3b5c2ff09d3b7b3a747b4ddade23a
MD5 6f181dac9e6a6e50dc729660c00213d7
BLAKE2b-256 e0895c306b6863bc5fe124354f418798252b311a8a0d9e2dca46a8ad534df535

See more details on using hashes here.

File details

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

File metadata

  • Download URL: strongpy-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2686218f1be251c7ea706e393ce6bf347d7926b6ec6b6c01376250aa9a50d2ea
MD5 b4c6f2e9e7e14066be5e43e0b3d84f11
BLAKE2b-256 87110ff3cf4da25645172de51d936f7e499d331594eead87fcae277eeaebb761

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