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 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
  • 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.3.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.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: strongpy-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 f31d2be3c8694d6ee4b54b920cb4afa2986571e4ef8d288ffeadfffed51a30c1
MD5 c8deda2daa0c7901bb181f160485b4b0
BLAKE2b-256 6394b16db3a1a3496b709cdae1e62002f39697413785e0475f0f1f0cd4a7b2f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: strongpy-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e8c6b9acbe6ab7bad781cdecf30eadeaaae1b4e1d730c62c4c6495cf0e4ccd0b
MD5 5be74eb7f1328984622ddb767904c198
BLAKE2b-256 c7d7d3a4f5af4135e61e115dd4f2ffd817bfaff1f3339d9707767ba52c90b55a

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