From Newsgroup: comp.lang.python.announce
Hi All,
I am happy to announce **func-validator 1.2.0** release, this version
provides custom error messages for validators via the "err_msg" optional keyword argument.
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(err_msg="a must be greater
than 0")], b: Annotated[float, MustBeNegative(err_msg="b must be less
than 0")]):
...
```
**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
[email protected]
--- Synchronet 3.21a-Linux NewsLink 1.2