https://github.com/patrickboateng/func-validator
MATLAB-style function argument validation for Python - clean, simple, and reliable.
https://github.com/patrickboateng/func-validator
argument-validation function validation
Last synced: 10 months ago
JSON representation
MATLAB-style function argument validation for Python - clean, simple, and reliable.
- Host: GitHub
- URL: https://github.com/patrickboateng/func-validator
- Owner: patrickboateng
- License: mit
- Created: 2025-08-08T20:44:33.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-08-10T00:16:27.000Z (10 months ago)
- Last Synced: 2025-08-10T00:19:32.117Z (10 months ago)
- Topics: argument-validation, function, validation
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# func-validator
[](https://pypi.org/project/func-validator/)
[](https://pypi.python.org/pypi/func-validator/)
[](https://opensource.org/license/mit/)
MATLAB-style function argument validation for Python.
## Installation
```sh
$ pip install func-validator
```
## Usage
```py
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