Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Python package to validate data against whip specifications

License

NotificationsYou must be signed in to change notification settings

inbo/pywhip

Repository files navigation

Build StatusBuild StatusUpdates

The pywhip package is a Python package to validate data againstwhip specifications, a human and machine-readable syntax to express specifications for data.

Check thedocumentation pages for more information.

Installation

To install pywhip, run this command in your terminal:

pip install pywhip

For more detailed installation instructions, see thedocumentation pages.

Test pywhip in jupyter notebook

Launch a jupyter notebook to interactively try out the pywhip package:

Binder

Quickstart

To validate a CSV data file with the field headerscountry,eventDate andindividualCount, write whip specifications, according to thewhip syntax:

specifications = """country:allowed:[BE, NL]eventDate:dateformat:'%Y-%m-%d'mindate:2016-01-01maxdate:2018-12-31individualCount:numberformat: x# needs to be an integer valuemin:1max:100"""

To whip your data set, e.g.my_data.csv, pass the data to whip specifications:

frompywhipimportwhip_csvexample=whip_csv("my_data.csv",specifications,delimiter=',')

and write the output report to an html file:

withopen("report_example.html","w")asindex_page:index_page.write(example.get_report('html'))

Resulting in areport like this. For a more detailed introduction, seethe documentaton tutorial.

Credits

This package was created withCookiecutter and theaudreyr/cookiecutter-pypackage project template.

Validation of data rows is using theCerberus package.


[8]ページ先頭

©2009-2025 Movatter.jp