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)
Metadata
Release files for valida 0.7.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| valida-0.7.5.tar.gz | 23.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| valida-0.7.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 50.4 kB
Release files / valida-0.7.5.tar.gz
| Download URL | valida-0.7.5.tar.gz |
|---|---|
| Size | 23.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86bb6d187552f18f7d773550bc985304ec71913cc61d659f3d454bb42a7694d3
|
|
BLAKE2b-256 checksum How to use checksums |
d4ab738588ae16c5843b1873d5ef4bebc7e25ea55b09697d88bd0f3d3c962ba3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.11.10 Linux/6.5.0-1025-azure
|
Release files / valida-0.7.5-py3-none-any.whl
| Download URL | valida-0.7.5-py3-none-any.whl |
|---|---|
| Size | 26.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4dc3a3b5cfc228327d44fe59dc08cdea2728124ec2ac40d1fcd76c5ba8da6c9b
|
|
BLAKE2b-256 checksum How to use checksums |
9d40096a60e48c2ef1b1a48caa78e3afac5e2f780ebc98f81d2373f3149f1c0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.11.10 Linux/6.5.0-1025-azure
|