Skip to main content

Enforcer

Enforcer is a lightweight Python decorator for enforcing type hints at runtime. It ensures that function arguments match their specified types, providing a simple and intuitive solution for runtime type validation.

Features

  • Enforce type hints at runtime for functions.
  • Lightweight and dependency-free.
  • Compatible with Python 3.7 and later.

Installation

You can install Enforcer via pip (coming soon):

from enforcer import enforce_types

@enforce_types
def greet(name: str, age: int):
    print(f"{name} is {age} years old!")

# Valid call
greet("Alice", 25)

# Invalid call
greet("Alice", "twenty-five")  # Raises TypeError

Contributing

Contributions are welcome! Please check the issues for tasks that need help.

Metadata

Release files for static-type-enforcer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for static-type-enforcer 0.1.0
File Size Uploaded Provenance Actions
static_type_enforcer-0.1.0.tar.gz 3.7 kB Without provenance Details for static_type_enforcer-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for static-type-enforcer 0.1.0
File Interpreter ABI Platform Actions
static_type_enforcer-0.1.0-py3-none-any.whl Python 3 none any Details for static_type_enforcer-0.1.0-py3-none-any.whl

Total release size: 8.0 kB

Release files / static_type_enforcer-0.1.0.tar.gz

Download URL static_type_enforcer-0.1.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c9f96c1cf5c0fc08571629564e6f4e2bdf7a60fdbf11f61102e96346650b2365
BLAKE2b-256 checksum
How to use checksums
33d66461ab67f26cd19c4571d85d63b0e41384c950ac2aa826be2bb77b247b71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / static_type_enforcer-0.1.0-py3-none-any.whl

Download URL static_type_enforcer-0.1.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2307a6e1d7f98af1790d023b0512f4171688a510c2b3855b1f00c096de84d3d5
BLAKE2b-256 checksum
How to use checksums
d10bab8576fb88551a2b9e1877beee27ed732ba8584c92d515338d4a54f948cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Security for static-type-enforcer 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page