pandas-validator
Validates the pandas object such as DataFrame and Series. And this can define validator like django form class.
Why bugs occur in Data Wrangling with pandas
When we wrangle our data with pandas, We use DataFrame frequently. DataFrame is very powerfull and easy to handle. But DataFrame has no it’s schema, so It allows irregular values without being aware of it. We are confused by these values and affect the results of data wrangling.
pandas-schema offers the functions for validating DataFrame or Series objects and generating factory data.
Overview
import pandas as pd
import pandas_validator as pv
class SampleDataFrameValidator(pv.DataFrameValidator):
row_num = 5
column_num = 2
label1 = pv.IntegerColumnValidator('label1', min_value=0, max_value=10)
label2 = pv.FloatColumnValidator('label2', min_value=0, max_value=10)
validator = SampleDataFrameValidator()
df = pd.DataFrame({'label1': [0, 1, 2, 3, 4], 'label2': [5.0, 6.0, 7.0, 8.0, 9.0]})
validator.is_valid(df) # True.
df = pd.DataFrame({'label1': [11, 12, 13, 14, 15], 'label2': [5.0, 6.0, 7.0, 8.0, 9.0]})
validator.is_valid(df) # False.
df = pd.DataFrame({'label1': [0, 1, 2], 'label2': [5.0, 6.0, 7.0]})
validator.is_valid(df) # False
Getting Started
Requirements
Support python version: 2.7, 3.4, 3.5, 3.6
Support pandas version: 0.18, 0.19
Installation
$ pip install pandas_validator
Usage
Please see the following demo written by ipython notebook.
License
This software is licensed under the MIT License.
Resources
CHANGES
0.5.0 (2017-01-06)
Add LambdaColumnValidator
Add IndexValidator
.validate(df) method is deprecated. Please use .is_valid(df, raise_exception=True)
0.4.0 (2015-10-28)
Hot fix: cannot include source file
0.3.2 (2015-10-28)
Python 2.7, 3.2, 3.3, 3.4, 3.5 support
pandas 0.14, 0.15, 0.16, 0.17 support
0.3.1 (2015-10-28)
Update support python version
Update dependencies library version
0.3.0 (2015-07-15)
Critical bug fix
0.2.0 (2015-05-24)
Support char type validation
flake8 testing
0.1.0 (2015-05-22)
Initial release.
Support integer series validator
Support float series validator
Support dataframe validator
Testing on python2.7 and python 3.4
0.0.0 (2015-05-17)
Create this project.
Metadata
Release files for pandas_validator 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pandas_validator-0.5.0.tar.gz | 7.1 kB | Without provenance | Details for pandas_validator-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pandas_validator-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for pandas_validator-0.5.0-py3-none-any.whl |
Total release size: 18.2 kB
Release files / pandas_validator-0.5.0.tar.gz
| Download URL | pandas_validator-0.5.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efce7020d4fdc8223cf0914024f44a08f49944b42155b8fa8168337594a7d769
|
|
BLAKE2b-256 checksum How to use checksums |
b0e60eef159823ff6fe01ae62bf431d6ab00b3cfe30d11335e87a22ab7d0fe54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pandas_validator-0.5.0-py3-none-any.whl
| Download URL | pandas_validator-0.5.0-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fab6e98dda5ec4311a351ac679b45e9635344289fa543b12ae138ea0f1ff8125
|
|
BLAKE2b-256 checksum How to use checksums |
95bef6981d78f645ced722a09143efe4d7195afd40ffc3bb648c1d0d5b2ac2ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pandas_validator 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.