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.7.0.tar.gz (5.2 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.7.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: func_validator-0.7.0.tar.gz
  • Upload date:
  • Size: 5.2 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.7.0.tar.gz
Algorithm Hash digest
SHA256 1c6c78c58773a1f552d511c6733aa38ff5684ebb6d8a7ef4c39d87164fc7b70c
MD5 3e4b47fb8351290d1fd4779d02f5a803
BLAKE2b-256 75324f88bb2646ef644c004dda830e1ae0760ab6799062c1d0c8ee8eebaaa9b8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: func_validator-0.7.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

Hashes for func_validator-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2422ec51b229277618551738589b671a3f6c710a7ebd604ea881ef7b482d701a
MD5 a264b06cd1f2c3dafac7c3902503ca13
BLAKE2b-256 786ce7b2af8d922771c1f7c7eec9135fce61f15ff7a84714ae833944b6554eea

See more details on using hashes here.

Provenance

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