MATLAB-style function argument validation for Python - clean, simple, and reliable.
Project description
func-validator
MATLAB-style function argument validation for Python.
Installation
$ pip install func-validator
Usage
from typing import Annotated
from func_validator import validate, MustBePositive, MustBeNegative
@validate
def func(a: Annotated[int, MustBePositive],
b: Annotated[float, MustBeNegative]):
pass
func(10, -10) # ✅
func(-10, 10) # ❌
func(0, -10) # ❌ Wrong 0 is not positive
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file func_validator-0.6.0.tar.gz.
File metadata
- Download URL: func_validator-0.6.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4440751cb92d67d0593f5a636dd08426355aeb7eab39d677fa5cbb46b6ba8df6
|
|
| MD5 |
a6f2baa03da8627538c7b77edca2d330
|
|
| BLAKE2b-256 |
363bbf0ce1d25362921b4aac1f509e9d9c4d6934c0ab566e733ec2f74d19134f
|
Provenance
The following attestation bundles were made for func_validator-0.6.0.tar.gz:
Publisher:
func-validator-publish.yml on patrickboateng/func-validator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
func_validator-0.6.0.tar.gz -
Subject digest:
4440751cb92d67d0593f5a636dd08426355aeb7eab39d677fa5cbb46b6ba8df6 - Sigstore transparency entry: 375107764
- Sigstore integration time:
-
Permalink:
patrickboateng/func-validator@9110340e4e116bfa3a1c7411c807c4febc4c353f -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/patrickboateng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
func-validator-publish.yml@9110340e4e116bfa3a1c7411c807c4febc4c353f -
Trigger Event:
push
-
Statement type:
File details
Details for the file func_validator-0.6.0-py3-none-any.whl.
File metadata
- Download URL: func_validator-0.6.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a7366542bf696e73af8b4419d7ac57b4216cc5ca2d46967aab7a4caf4a49fdc
|
|
| MD5 |
90a75fe1a50b12e7af4b3d9de760f4c6
|
|
| BLAKE2b-256 |
735465118910dff70810ea579bf0d3ce596ca4cfd7b467a719a4142cf1ab4d7f
|
Provenance
The following attestation bundles were made for func_validator-0.6.0-py3-none-any.whl:
Publisher:
func-validator-publish.yml on patrickboateng/func-validator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
func_validator-0.6.0-py3-none-any.whl -
Subject digest:
3a7366542bf696e73af8b4419d7ac57b4216cc5ca2d46967aab7a4caf4a49fdc - Sigstore transparency entry: 375107792
- Sigstore integration time:
-
Permalink:
patrickboateng/func-validator@9110340e4e116bfa3a1c7411c807c4febc4c353f -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/patrickboateng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
func-validator-publish.yml@9110340e4e116bfa3a1c7411c807c4febc4c353f -
Trigger Event:
push
-
Statement type: