From Newsgroup: comp.lang.python.announce
Hi All,
I am happy to announce **func-validator 1.1.1** , which provides
argument validation for
python functions and methods. The main objective is to remove argument validation from
the function's body which reduces lines of code and improves code
readability.
This package was inspired by MATLAB’s argument validation framework, bringing a similar level
of clarity and structure to Python function definitions.
Below is a quick example:
```python
from typing import Annotated
from func_validator import validate_params, MustBePositive, MustBeNegative
@validate_params
def func(a: Annotated[int, MustBePositive()], b: Annotated[float, MustBeNegative()]):
...
```
**Links**
* PYPI:
https://pypi.org/project/func-validator/
* GitHub:
https://github.com/patrickboateng/func-validator
* Docs:
https://func-validator.readthedocs.io/en/latest/
**Install**
pip install func-validator
Compatible with Python 3.11 - 3.13. Licensed under MIT
Best,
Patrick Boateng
patrickboateng@patrickboateng.tech
--- Synchronet 3.21a-Linux NewsLink 1.2