vali-helper is a util to help define the value checker on a function.
Project description
vali-helper
Description
valid-helper is a util that helps define the validation to the parameters of functions
Installation
pip install vali_helper
Instructions
This package is very easy to use. There are some pre-defined validation classes. For example, if a function give_money has an int parameter money, and it requires the parameter is greater than "0", it can be written in the below following form:
from vali import *
@validator(valis=[GreaterThan(name='money', value=0)])
def give_money(money: int | float):
print(money)
>>> give_money(-10)
Traceback (most recent call last):
vali.validation.ValiFailError: The validation value must greater than 0, but provided -10
More examples could be referred to src/vali/tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vali_helper-1.1.0.tar.gz.
File metadata
- Download URL: vali_helper-1.1.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa845259cae4901750c59f3c4f43cbd82cf81cf0abaf366c17818450db8f57e8
|
|
| MD5 |
3f6f841041104801d236c7b2a1fc357a
|
|
| BLAKE2b-256 |
d4755f18e37e6949ac4ab94fbaf63853786c7908464e78f0526774c7a51db289
|
File details
Details for the file vali_helper-1.1.0-py3-none-any.whl.
File metadata
- Download URL: vali_helper-1.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
368e4e9e52926869d759925458a5948737badb0474472236539c3a829c03e365
|
|
| MD5 |
6bfbd0683ecd0ec05914de1dcde5ff95
|
|
| BLAKE2b-256 |
eb71c7730739e6522e9e616541f5cdeda57096eab06a05d51f9af8341041f25c
|