This release is a pre-release and may not be stable for production use.
aval
Abstract
Abstract Validator (AVal) is a class implemented in Python, capable
of taking a list of specific validation strategies (with parameters), as well
as a method for handling exceptional situations, and applying these methods to
the validation object. The Abstract Validator can be used by calling the
validation method on an instance of a class, as well as a decorator.
Installation
Use:
pip install aval
Basic usage
def _is_string(obj: v.VObj, params: v.VParams) -> None:
t = type(obj)
if t != str:
raise v.ValidationError('Some description')
def _correct_length(obj: v.VObj, params: v.VParams) -> None:
mn = params.get('min_length', 1)
mx = params.get('max_length', 32)
ln = len(obj)
if not mn <= ln <= mx:
raise v.ValidationError('Some description'
)
vld = v.Validator([_is_string, _correct_length])
vld.validate('Any message')
Details
More detailed documentation (in Russian) can be found at https://docs.mxustin.ru/micro/validator/manual/intro
Metadata
Release files for aval 0.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aval-0.0b1.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aval-0.0b1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.0 kB
Release files / aval-0.0b1.tar.gz
| Download URL | aval-0.0b1.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31430763773ea391a29b36d83d29fe07132dea7567d2eaeb90a7f856406bdff9
|
|
BLAKE2b-256 checksum How to use checksums |
c862fd27820a2fbdab6457dd91245df68fa9a76607ae73f43c6899234cfc9c5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.13.0b2
|
Release files / aval-0.0b1-py3-none-any.whl
| Download URL | aval-0.0b1-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9bf9433e88c1b3ddb9360863dbc2d38b9b54b66ef7d2fa3808fb0dc59c5f081
|
|
BLAKE2b-256 checksum How to use checksums |
6ce37d64526f2b39f267ccea9b1184272ccd7780e187a4f984dbbc17d9dd226d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.13.0b2
|