forked from frictionlessdata/frictionless-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontrib_checks.py
47 lines (32 loc) · 896 Bytes
/
contrib_checks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from pprint import pprint
from goodtables import validate
# blacklisted-value
report = validate('data/blacklisted_value.csv', checks=[
{'blacklisted-value': {'column': 'name', 'blacklist': ['bug', 'bad']}},
])
pprint(report)
pprint('---')
# deviated-value
report = validate('data/deviated_value.csv', checks=[
{'deviated-value': {'column': 'temperature', 'average': 'median', 'interval': 3}},
])
pprint(report)
pprint('---')
# sequential-value
report = validate('data/sequential_value.csv', checks=[
{'sequential-value': {'column': 'id'}},
])
pprint(report)
pprint('---')
# truncated-value
report = validate('data/truncated_value.csv', checks=[
'truncated-value',
])
pprint(report)
pprint('---')
# custom-check
report = validate('data/custom_constraint.csv', checks=[
{'custom-constraint': {'constraint': 'salary > bonus * 4'}},
])
pprint(report)
pprint('---')