Comprehensive validation library for nested data structures.
Project description
Validation for nested data structures
Installing
pip install valida
A simple example
from valida import Data, Value, Rule
# Define some data that we want to validate:
my_data = Data({'A': 1, 'B': [1, 2, 3], 'C': {'c1': 8.2, 'c2': 'hello'}})
# Define a rule as a path within the data and a condition at that path:
rule = Rule(
path=('C', 'c2'),
condition=Value.dtype.equal_to(str),
)
# Test the rule
rule.test(my_data).is_valid # `True` => The rule tested successfully
Acknowledgements
Valida was developed using funding from the LightForm EPSRC programme grant (EP/R001715/1)
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
valida-0.7.5.tar.gz
(23.6 kB
view details)
Built Distribution
valida-0.7.5-py3-none-any.whl
(26.8 kB
view details)
File details
Details for the file valida-0.7.5.tar.gz
.
File metadata
- Download URL: valida-0.7.5.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.11.10 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86bb6d187552f18f7d773550bc985304ec71913cc61d659f3d454bb42a7694d3 |
|
MD5 | 40ddb6960eda56154ecc7b1ecf95564d |
|
BLAKE2b-256 | d4ab738588ae16c5843b1873d5ef4bebc7e25ea55b09697d88bd0f3d3c962ba3 |
File details
Details for the file valida-0.7.5-py3-none-any.whl
.
File metadata
- Download URL: valida-0.7.5-py3-none-any.whl
- Upload date:
- Size: 26.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.11.10 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dc3a3b5cfc228327d44fe59dc08cdea2728124ec2ac40d1fcd76c5ba8da6c9b |
|
MD5 | d6c507ebdbf9aafeab6f658ef70c95a8 |
|
BLAKE2b-256 | 9d40096a60e48c2ef1b1a48caa78e3afac5e2f780ebc98f81d2373f3149f1c0d |