Is your data meeting all your expecations
Project description
data_expectations
Is your data meeting your expectations?
Data Expectations is in Beta - minor changes to interface and usage patterns should be expected
A delarative approach to asserting qualities of your datasets. Instead of tests like
is_sorted
to determine if a column is ordered, the expectation is
column_values_are_increasing
. Most of the time you don't need to know how it got
like that, you are only interested what the data looks like.
Expectations can be used alongside, or in place of a schema validator, however Expectations is intended to perform validation of the data in a dataset, not just the structure of a table.
Expectations
- expect_column_to_exist
- expect_column_names_to_match_set
- expect_column_values_to_not_be_null
- expect_column_values_to_be_of_type
- expect_column_values_to_be_in_type_list
- expect_column_values_to_be_between
- expect_column_values_to_be_increasing
- expect_column_values_to_be_decreasing
- expect_column_values_to_be_in_set
- expect_column_values_to_match_regex
- expect_column_values_to_match_like
- expect_column_values_length_to_be_be
- expect_column_values_length_to_be_between
Install
pip install data_expectations
Example Usage
import data_expectations as de
TEST_DATA = {"name":"charles","age":12}
set_of_expectations = [
{"expectation": "expect_column_to_exist", "column": "name"},
{"expectation": "expect_column_to_exist", "column": "age"},
{"expectation": "expect_column_values_to_be_between", "column": "age", "minimum": 0, "maximum": 120},
]
expectations = de.Expectations(set_of_expectations)
try:
de.evaluate_record(expectations, TEST_DATA)
except de.errors.ExpectationNotMetError:
print("Data Didn't Meet Expectations")
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
data_expectations-0.1.0.tar.gz
(12.3 kB
view hashes)
Built Distribution
Close
Hashes for data_expectations-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bf685ea6385e871aa12394f0ae917baf35b3c0bbc31fcd71dc19b96be51b59c |
|
MD5 | b4050ec03e63b5082ba45fb46a506e3d |
|
BLAKE2b-256 | 138439559a19f4ca5749ca422a7162aab65733ba05128f8a5bb783c7344ba061 |