Python package to validate data against whip specifications
Project description
pywhip
The pywhip package is a Python package to validate data against whip specifications, a human and machine-readable syntax to express specifications for data.
- Free software: MIT license
- Documentation: https://inbo.github.io/pywhip
Check the documentation pages for more information.
Installation
To install pywhip, run this command in your terminal:
pip install pywhip
For more detailed installation instructions, see the documentation pages.
Test pywhip in jupyter notebook
Launch a jupyter notebook to interactively try out the pywhip package:
Quickstart
To validate a CSV data file with the field headers country
, eventDate
and individualCount
, write whip specifications, according to the
whip syntax:
specifications = """
country:
allowed: [BE, NL]
eventDate:
dateformat: '%Y-%m-%d'
mindate: 2016-01-01
maxdate: 2018-12-31
individualCount:
numberformat: x # needs to be an integer value
min: 1
max: 100
"""
To whip your data set, e.g. my_data.csv
, pass the data to
whip specifications:
from pywhip import whip_csv
example = whip_csv("my_data.csv", specifications, delimiter=',')
and write the output report to an html file:
with open("report_example.html", "w") as index_page:
index_page.write(example.get_report('html'))
Resulting in a report like this. For a more detailed introduction, see the documentaton tutorial.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Validation of data rows is using the Cerberus package.
======= History
0.3.2 (2018-08-27)
- Hot fix on CLI tests
0.3.1 (2018-08-27)
- Add CLI support to pywhip for CSV files
0.3.0 (2018-08-23)
- Update to new whip specifications
- Support csv and Darwin Core Archive handling
- Add html and json reporting
- Provide updated sphinx documentation
0.2.1 (2018-04-06)
- Update towards new cerberus version
0.1.1 (2017-09-12)
- First release on PyPI.
- Package structure with CI integration
- tox testing on multiple Python versions
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
Built Distribution
File details
Details for the file pywhip-0.3.3.tar.gz
.
File metadata
- Download URL: pywhip-0.3.3.tar.gz
- Upload date:
- Size: 56.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1283da938adc6372f8ee280d399084c3c76a415d395da2cf4b2a8ec94e1d4d8a |
|
MD5 | f977ccb9d4f93c066bce2ff0f8873faa |
|
BLAKE2b-256 | d77b47b7246c750e52e67bc18ad8da0cd0bdaf29e4a19536d31bfd4cb448cf2b |
File details
Details for the file pywhip-0.3.3-py2.py3-none-any.whl
.
File metadata
- Download URL: pywhip-0.3.3-py2.py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc61b7db655663fb18dc542f5376af00445009e02c9127332c407029644d1509 |
|
MD5 | a783cdc9bdeb9101edca3c6f0f9c9535 |
|
BLAKE2b-256 | d8daa084f084215c17d3b670c201fa27bdc3311ed6241584f456905340f1c474 |