Skip to main content

MATLAB-style function argument validation for Python - clean, simple, and reliable.

Project description

func-validator

PyPI Latest Release PyPI pyversions license

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

func_validator-0.5.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

func_validator-0.5.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file func_validator-0.5.0.tar.gz.

File metadata

  • Download URL: func_validator-0.5.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for func_validator-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d9b8b6a371d078b84c097ebcd25bc4a8915009c16cab34a8927b3e05924a8380
MD5 92383eb6336c26c910a821071fdc36c0
BLAKE2b-256 975568ec171dd0aabbe0342f786ee6513c830abab2971150abcce841df2f7941

See more details on using hashes here.

Provenance

The following attestation bundles were made for func_validator-0.5.0.tar.gz:

Publisher: func-validator-publish.yml on patrickboateng/func-validator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file func_validator-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: func_validator-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for func_validator-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 487ae6937e0f5a4bd1236ce898e1025e51c8803de2679c77f7992140627243a0
MD5 66e33dd22d7c2c06bc299e94aa5b5a16
BLAKE2b-256 604bcc90cfd5b92924a3bc359153c9f14e97ca1181813700cad9ea1826d69113

See more details on using hashes here.

Provenance

The following attestation bundles were made for func_validator-0.5.0-py3-none-any.whl:

Publisher: func-validator-publish.yml on patrickboateng/func-validator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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