data_linter
A python package that validates datasets against a metadata schema which is defined here.
It performs the following checks:
- Are the columns of the correct data types (or can they be converted without error using
pd.Series.astypein the case of untyped data formats likecsv) - Column names:
- Are the columns named correctly?
- Are they in the same order specified in the meta data
- Are there any missing columns?
- Where a regex
patternis provided in the metadata, does the actual data always fit thepattern - Where an
enumis provided in the metadata, does the actual data contain only values in theenum - Where
nullableis set to false in the metadata, are there really no nulls in the data?
The package also provides functionality to impose_metadata_types_on_pd_df, which allows the user to safely convert a pandas dataframe to the datatypes specified in the metadata. This is useful in the case you have an untyped data file such as a csv and want to ensure it is conformant with the metadata.
Usage
For detailed information about how to use the package, please see the demo repo. This includes an interactive tutorial that you can run in your web browser.
Here's a very basic example
import pandas as pd
import json
from data_linter.lint import Linter
def read_json_from_path(path):
with open(path) as f:
return_json = json.load(f)
return return_json
meta = read_json_from_path("tests/meta/test_meta_cols_valid.json")
df = pd.read_parquet("tests/data/test_parquet_data_valid.parquet")
l = Linter(df, meta)
l.check_all()
l.markdown_report()
Metadata
Release files for data_linter 0.1.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 |
|---|---|---|---|---|
| data_linter-0.1.0.tar.gz | 10.7 kB | Without provenance | Details for data_linter-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| data_linter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for data_linter-0.1.0-py3-none-any.whl |
Total release size: 23.8 kB
Release files / data_linter-0.1.0.tar.gz
| Download URL | data_linter-0.1.0.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a4ea28e01c8459189051a778c9779fed85256f44c318f429f634a93d01110fb
|
|
BLAKE2b-256 checksum How to use checksums |
c31e5a0a2c964d2fa07b7a7d855c406eef9b36a03fefc85d01ff3b880b03a725
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.6.9 Darwin/18.0.0
|
Release files / data_linter-0.1.0-py3-none-any.whl
| Download URL | data_linter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea4920005c62f89a3daaa4c3357dfe64e0373ec321c8f14b39257fdf0a0d2139
|
|
BLAKE2b-256 checksum How to use checksums |
49a5a0393051dfb52b00fd3df67717788ae0a4892a285270b4c56f39a986cbca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.6.9 Darwin/18.0.0
|
Security for data_linter 0.1.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.