Python package for validating datasets in the microdata platform
Project description
⚠️ Deprecation Notice ⚠️
This package has been deprecated. Please use the microdata-tools package.
microdata-validator
Python package for validating datasets in the microdata platform.
Dataset description
A dataset as defined in microdata consists of one data file, and one metadata file.
The data file is a csv file seperated by semicolons. A valid example would be:
000000000000001;123;2020-01-01;2020-12-31;
000000000000002;123;2020-01-01;2020-12-31;
000000000000003;123;2020-01-01;2020-12-31;
000000000000004;123;2020-01-01;2020-12-31;
Read more about the data format and columns in the documentation.
The metadata files should be in json format. The requirements for the metadata is best described through the json schema, the examples, and the documentation.
Basic usage
Once you have your metadata and data files ready to go, they should be named and stored like this:
my-input-directory/
MY_DATASET_NAME/
MY_DATASET_NAME.csv
MY_DATASET_NAME.json
Note that the filename only allows upper case letters A-Z, number 0-9 and underscores.
Then use pip to install microdata-validator:
pip install microdata-validator
Import microdata-validator in your script and validate your files:
from microdata_validator import validate
validation_errors = validate(
"MY_DATASET_NAME",
input_directory="path/to/my-input-directory"
)
if not validation_errors:
print("My dataset is valid")
else:
print("Dataset is invalid :(")
# You can print your errors like this:
for error in validation_errors:
print(error)
For a more in-depth explanation of usage visit the usage documentation.
Project details
Release history Release notifications | RSS feed
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 microdata_validator-7.3.5.tar.gz
.
File metadata
- Download URL: microdata_validator-7.3.5.tar.gz
- Upload date:
- Size: 27.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.10.12 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54f4f79cd5736513dc0edfd148dbba7b8bdab546ea39243d95b9f83ec221d1de |
|
MD5 | 598e7ae4df02152c851bf1dbde1422d3 |
|
BLAKE2b-256 | 541ccadafb142b55dbe8f42864c8dd99eac49a2a876c7435893e28bc8f029137 |
File details
Details for the file microdata_validator-7.3.5-py3-none-any.whl
.
File metadata
- Download URL: microdata_validator-7.3.5-py3-none-any.whl
- Upload date:
- Size: 34.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.10.12 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a124e684c173f13c1d4d9ec42e5b0523f8e3b11d9399dbd7d33ee12aad23baf |
|
MD5 | 999fa914cdc7aafb8630707e70abe0e3 |
|
BLAKE2b-256 | 347692d504c381acac5e3ec22ae7914fbcc9430efc88725c768bfcea72cc09f4 |