# pywhip
[![Build Status](https://img.shields.io/pypi/v/pywhip.svg)](https://pypi.python.org/pypi/pywhip)
[![Build Status](https://travis-ci.com/inbo/pywhip.svg?branch=master)](https://travis-ci.com/inbo/pywhip)
[![Updates](https://pyup.io/repos/github/inbo/pywhip/shield.svg)](https://pyup.io/repos/github/inbo/pywhip/)
The pywhip package is a Python package to validate data against [whip specifications](https://github.com/inbo/whip), 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](https://inbo.github.io/pywhip/installation.html) for more information.
## Installation
To install pywhip, run this command in your terminal:
```shell
pip install pywhip
```
For more detailed installation instructions, see the [documentation pages](https://inbo.github.io/pywhip/installation.html).
## Test pywhip in jupyter notebook
Launch a jupyter notebook to interactively try out the pywhip package:
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/inbo/pywhip/master?filepath=notebooks%2Fwhip_csv_data.ipynb)
## Quickstart
To validate a CSV data file with the field headers `country`, `eventDate` and `individualCount`, write whip specifications, according to the [whip syntax](https://github.com/inbo/whip):
```yaml
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:
```python
from pywhip import whip_csv
example = whip_csv("my_data.csv", specifications, delimiter=',')
```
and write the output report to an html file:
```python
with open("report_example.html", "w") as index_page:
index_page.write(example.get_report('html'))
```
Resulting in a [report](https://inbo.github.io/pywhip/report_observations.html) like this. For a more detailed introduction, see [the documentaton tutorial](https://inbo.github.io/pywhip/tutorial.html).
## Credits
This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template.
Validation of data rows is using the [Cerberus](http://docs.python-cerberus.org/en/stable/) package.
Raw data
{
"_id": null,
"home_page": "https://github.com/inbo/pywhip",
"name": "pywhip",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pywhip,whip,Darwin_Core_Archive,data validation",
"author": "Stijn Van Hoey",
"author_email": "stijn.vanhoey@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f6/c9/4021d1c7f09d4ec9442a0f324a64f39552106ed4537a6a0c0224f73e3483/pywhip-0.3.4.tar.gz",
"platform": null,
"description": "# pywhip\n\n[![Build Status](https://img.shields.io/pypi/v/pywhip.svg)](https://pypi.python.org/pypi/pywhip)\n[![Build Status](https://travis-ci.com/inbo/pywhip.svg?branch=master)](https://travis-ci.com/inbo/pywhip)\n[![Updates](https://pyup.io/repos/github/inbo/pywhip/shield.svg)](https://pyup.io/repos/github/inbo/pywhip/)\n\nThe pywhip package is a Python package to validate data against [whip specifications](https://github.com/inbo/whip), a human and machine-readable syntax to express specifications for data.\n\n* Free software: MIT license\n* Documentation: https://inbo.github.io/pywhip\n\nCheck the [documentation pages](https://inbo.github.io/pywhip/installation.html) for more information.\n\n## Installation\n\nTo install pywhip, run this command in your terminal:\n\n```shell\npip install pywhip\n```\n\nFor more detailed installation instructions, see the [documentation pages](https://inbo.github.io/pywhip/installation.html).\n\n## Test pywhip in jupyter notebook\n\nLaunch a jupyter notebook to interactively try out the pywhip package:\n\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/inbo/pywhip/master?filepath=notebooks%2Fwhip_csv_data.ipynb)\n\n## Quickstart\n\nTo validate a CSV data file with the field headers `country`, `eventDate` and `individualCount`, write whip specifications, according to the [whip syntax](https://github.com/inbo/whip):\n\n```yaml\nspecifications = \"\"\"\n country:\n allowed: [BE, NL]\n eventDate:\n dateformat: '%Y-%m-%d'\n mindate: 2016-01-01\n maxdate: 2018-12-31\n individualCount:\n numberformat: x # needs to be an integer value\n min: 1\n max: 100\n \"\"\"\n```\n\nTo whip your data set, e.g. ``my_data.csv``, pass the data to whip specifications:\n\n\n```python\nfrom pywhip import whip_csv\n\nexample = whip_csv(\"my_data.csv\", specifications, delimiter=',')\n```\n\nand write the output report to an html file:\n\n```python\nwith open(\"report_example.html\", \"w\") as index_page:\n index_page.write(example.get_report('html'))\n```\n\nResulting in a [report](https://inbo.github.io/pywhip/report_observations.html) like this. For a more detailed introduction, see [the documentaton tutorial](https://inbo.github.io/pywhip/tutorial.html).\n\n## Credits\n\nThis package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template.\n\nValidation of data rows is using the [Cerberus](http://docs.python-cerberus.org/en/stable/) package.\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Python package to validate data against whip specifications",
"version": "0.3.4",
"split_keywords": [
"pywhip",
"whip",
"darwin_core_archive",
"data validation"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "88a8725448063732ac0d643822e6d201",
"sha256": "e88be204092ecb95ab24d65bfa7bd8163ff1f310a1403898460c2e943ed5faa7"
},
"downloads": -1,
"filename": "pywhip-0.3.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "88a8725448063732ac0d643822e6d201",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 18903,
"upload_time": "2022-12-16T12:52:43",
"upload_time_iso_8601": "2022-12-16T12:52:43.836814Z",
"url": "https://files.pythonhosted.org/packages/15/dd/a88f9f164f85ac787715a86425d5d4f46ef6ec8fdf39bf1ee648959b326c/pywhip-0.3.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "7aca6f0339424d3dc8888bdd6aed6a7c",
"sha256": "ee30d5182e34bbeb54dc6db06a784a770c41eff2f945b5ab09653821eba5f471"
},
"downloads": -1,
"filename": "pywhip-0.3.4.tar.gz",
"has_sig": false,
"md5_digest": "7aca6f0339424d3dc8888bdd6aed6a7c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 56056,
"upload_time": "2022-12-16T12:52:45",
"upload_time_iso_8601": "2022-12-16T12:52:45.469654Z",
"url": "https://files.pythonhosted.org/packages/f6/c9/4021d1c7f09d4ec9442a0f324a64f39552106ed4537a6a0c0224f73e3483/pywhip-0.3.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-16 12:52:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "inbo",
"github_project": "pywhip",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"requirements": [],
"tox": true,
"lcname": "pywhip"
}