Skip to main content

Comprehensive validation library for nested data structures.

Project description

Valida logo

Validation for nested data structures

PyPI version Testing workflow Supported python versions License DOI

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


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.2.tar.gz (23.6 kB view hashes)

Uploaded Source

Built Distribution

valida-0.7.2-py3-none-any.whl (26.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page