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.1.tar.gz (6.5 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.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: strongpy-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 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.1.tar.gz
Algorithm Hash digest
SHA256 bc613d707c3a507454d6576c708d2863ad0efbdf92e47f520764cb1304c3d07b
MD5 6de6a78ea293bb9e78d639ffea1b43c7
BLAKE2b-256 3a81bc35be23fc05c017167db09ffd3a88d247cb523ac26ccc43126f01321443

See more details on using hashes here.

File details

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

File metadata

  • Download URL: strongpy-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 130ff21b5df2318a5f59d1840e8e03845bbd6fa3fd481097eff9ad2f91aac69d
MD5 8dd04a4c0fce5903d7dabc5dcda09312
BLAKE2b-256 2971802456445e47f9e831f139e51533909d7d607d721d61d4568995e22599cf

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