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.2.0.tar.gz (4.3 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.2.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: func_validator-0.2.0.tar.gz
  • Upload date:
  • Size: 4.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 2df4f16c5fe31eb36cd6492dde1d33f7c9ab7609e540b741be88248ac43e3cac
MD5 1c03e28491cdb3c230d19057aff5ecde
BLAKE2b-256 8eb78e90366aa0986e8149a309e8e6f237bb8051e9c9298e05e016e6383e7b23

See more details on using hashes here.

Provenance

The following attestation bundles were made for func_validator-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: func_validator-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66c9c47541a0e560f9a665e6a0e4b10425bb1cfaac770d90a4675079395ffdf1
MD5 adbc42438f4216c869dc3d76892b22ec
BLAKE2b-256 b7d343964b2bc2b6468f22cc701b3ab91015012a8a075b7a1c3efe58b439fddd

See more details on using hashes here.

Provenance

The following attestation bundles were made for func_validator-0.2.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