Skip to main content

Runtime type checker

Project description

⚡ Strongpy

A simple runtime type checker for Python functions.

Version License Downloads

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

>>> add(1, 2)
3

>>> add("1", 2)
Traceback (most recent call last):
  File "example.py", line 10, in <module>
    add("1", 2)
TypeError: 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
  • Any
  • Never
  • NoReturn

⚙️ 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.5.tar.gz (7.3 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.5-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: strongpy-0.1.5.tar.gz
  • Upload date:
  • Size: 7.3 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.5.tar.gz
Algorithm Hash digest
SHA256 3b8a0d3db27bdb966a77f1ac48b5819b322d59ff1718154d6c212f73bc3d1e41
MD5 1fe3e5ecbd054251c503e2c283b78540
BLAKE2b-256 1c64f0a7234af471949e05b3216456fb5c127ca157873dae9b3f326820de5853

See more details on using hashes here.

File details

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

File metadata

  • Download URL: strongpy-0.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8de4d1d69ef2697719d7d1ae812c1060030091d3562b3ac77d20fb85965b9aed
MD5 2ff0c155d0b09711b36a42e71567955f
BLAKE2b-256 def1fa7ea5b65f49d50f47222886e6984120c84665f492d68fe07ad90ed34756

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