A simple schema builder for value parsing and validation
Project description
PyYep
PyYep is a python schema builder for value parsing and validation. Define a schema, transform a value to match and validate the inputs with existing validator or custom functions.
PyYep is heavily inspired by Yup
Install
pip install PyYep
Usage
You define and create schema objects with its inputs and validation methods. Then use the verify method to check the schema. A ValidationError will be raised if some input value does not match the validation.
from PyYep import Schema, InputItem, ValidationError
schema = Schema([
InputItem('name', input_object, 'path-to-input_object-value-property-or-method').string().email(),
InputItem('name', input_object, 'path-to-input_object-value-property-or-method').number().min(10).max(100),
], abort_early=False)
// check validity
try:
result = schema.validate()
# handle result
except ValidationError:
# handle fail
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 PyYep-0.0.4.dev0.tar.gz.
File metadata
- Download URL: PyYep-0.0.4.dev0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98669de7af8662014e9988ba82ebd1fde5a5d1c9799afd97eac4b573d9d230b1
|
|
| MD5 |
dd6f5a1811470caf7663f4727065ee4a
|
|
| BLAKE2b-256 |
667e9ed4b8fb275b29bbc2d73672e3a0ddb562cc78cf4dc3d3cc848be44dcda4
|
File details
Details for the file PyYep-0.0.4.dev0-py3-none-any.whl.
File metadata
- Download URL: PyYep-0.0.4.dev0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8828cc79f28dded7c05ea5b9a1362bcb02b1ce6088dcc0a2bcf52ba419b490f4
|
|
| MD5 |
b32f8cb09d2da8168d6a66d73f932146
|
|
| BLAKE2b-256 |
fc2770ce9f542e1bf293a6937cd57fc00318b302b7b1c6a3c826af33977a49c1
|