Data Validation Gini (DVG) CLI for row count and row/column comparison with HTML reports
Project description
Data Validation Gini (DVG)
Data Validation Gini is a lightweight Python CLI for validating source and target datasets and generating a rich HTML reconciliation report.
The repository also includes a CSV data mutation utility (data_corruptor.py) to create controlled mismatches for validation testing.
What This Project Does
- Compares source vs target files using row-level and cell-level checks.
- Supports CSV and Excel (
.xlsx,.xlsm,.xltx) inputs. - Supports single-sheet and multi-sheet validation (via sheet mapping).
- Produces a styled, filterable HTML report with KPI summary cards.
- Includes repeatable batch scripts for common mutation and validation scenarios.
Current Validation Modes
ROWCOUNT: checks source/target data row counts.ROW_COL_VALIDATION: checks headers and row/column values.- Combined mode: pass both as comma-separated values:
ROWCOUNT,ROW_COL_VALIDATION
Key Features in Current Implementation
- Header mismatch detection:
- header length mismatches
- header name mismatches
- Row alignment using preferred key columns:
employee_id,id,emp_id,record_id,pk- falls back to first column if no preferred key exists
- Mismatch classification:
CELLSRC_ONLYTGT_ONLYHEADER_LENGTHHEADER_NAMEROWCOUNT
- HTML report KPIs:
- SRC Count
- TGT Count
- PASSED
- FAILED
- Pass Rate
- Failed Rate
- SRC Only
- TGT Only
- Per-column filter inputs in mismatch table for quick triage.
Requirements
- Python 3.9+
- Packages:
openpyxlpytest(for tests)python-dotenv
Install dependencies:
pip install -r requirements.txt
Quick Start (Windows Batch Flow)
From project root:
001_env.bat
002_activate.bat
003_setup.bat
Run all mutation scenarios:
004_run.bat
Run a DVG validation and generate HTML:
dvg.bat
Run sheet mapping validation (Excel to Excel):
006_run_sheet_mapping.bat
Deactivate venv:
008_deactivate.bat
CLI Usage
DVG Validator
python dvg.py \
--file-type EXCEL \
--src-path inputs/employees.csv \
--tgt-path outputs/employees.csv \
--validation-type ROWCOUNT,ROW_COL_VALIDATION \
--html-output output/report_<datetime>.html
Optional arguments:
--src-sheet <sheet_name>--tgt-sheet <sheet_name>--sheet-mapping "SRC1:TGT1,SRC2:TGT2"--chunk-size <positive_int>(default:1000)
Notes:
--sheet-mappingis supported only for Excel file pairs.--file-typecurrently acceptsEXCEL(for both CSV and Excel processing paths).<datetime>token in--html-outputis replaced at runtime withYYYYMMDD_HHMMSS.--chunk-sizecontrols the number of data rows read per batch for CSV/XLSX loading.- Console output now shows chunk progress for source/target loading: total chunks, current chunk, and completion summary.
Large-file tuning tip:
- Start with
--chunk-size 1000(default), then increase to2000or5000for faster reads if memory allows. - In
dvg.bat, setCHUNK_SIZEin the config block to tune batch size without changing CLI commands.
Installed CLI Entry Point
If installed as a package, you can run:
dvg --file-type EXCEL --src-path ... --tgt-path ... --validation-type ROWCOUNT
Data Mutation Utility (data_corruptor.py)
Use this utility to generate controlled data drift before validation.
Example:
python data_corruptor.py \
--input inputs/employees.csv \
--output outputs/employees_typos.csv \
--column email \
--percentage 1.0 \
--type typo
Supported mutation types:
nullify- Replaces selected values with blank strings.
- Purpose: validate missing-value detection.
case_swap- Swaps letter casing in selected values.
- Purpose: validate case sensitivity behavior.
numeric_shift- Adds/subtracts a numeric offset (
--value). - Purpose: validate precision and tolerance checks.
- Adds/subtracts a numeric offset (
date_shift- Shifts date/datetime values by day count (
--value). - Supported formats:
YYYY-MM-DD,YYYY-MM-DD HH:MM:SS. - Purpose: validate temporal drift handling.
- Shifts date/datetime values by day count (
typo- Randomly replaces one character in selected strings.
- Purpose: validate strict text/hash mismatch detection.
Sample Scenario Scripts
run_case_swap.batrun_date_shift.batrun_nullify.batrun_numeric_shift.batrun_typo.bat
Each script mutates inputs/employees.csv into a corresponding file under outputs/.
Reports
Generated reports are written under output/ and include:
- high-level pass/fail status
- validation metadata (source, target, validation type, timestamp)
- KPI cards
- detailed mismatch table with filters
Tests
Run tests with:
pytest
Project Structure (High Level)
dvg.py- validation CLIdvg_report.py- HTML report generationdata_corruptor.py- mutation utilityinputs/- baseline sample datasetsoutputs/- mutated sample datasetsoutput/- generated report filestests/- unit tests
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file data_validation_gini-0.1.6.tar.gz.
File metadata
- Download URL: data_validation_gini-0.1.6.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94019336d7f99739def5ed941b923f60f9464b068fe4eea692e617d3fb96c519
|
|
| MD5 |
c59040286f363144a6e9a0e39e4838c7
|
|
| BLAKE2b-256 |
526d27559415b8b65774f7a63893c3682c4e3bb9e7ec2ba5825ca8e2d6f6a697
|
Provenance
The following attestation bundles were made for data_validation_gini-0.1.6.tar.gz:
Publisher:
publish-pypi.yml on ShanKonduru/data-validation-gini
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
data_validation_gini-0.1.6.tar.gz -
Subject digest:
94019336d7f99739def5ed941b923f60f9464b068fe4eea692e617d3fb96c519 - Sigstore transparency entry: 1553559744
- Sigstore integration time:
-
Permalink:
ShanKonduru/data-validation-gini@992ece7b10c72efed303ffc25d65a051725f733d -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/ShanKonduru
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@992ece7b10c72efed303ffc25d65a051725f733d -
Trigger Event:
push
-
Statement type:
File details
Details for the file data_validation_gini-0.1.6-py3-none-any.whl.
File metadata
- Download URL: data_validation_gini-0.1.6-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
903b8cd65250630a6474ee119140a05507f21b9c352c776a53b54cdf61b71ab8
|
|
| MD5 |
2aac52d68d4cb63ebb14fcc0585f0776
|
|
| BLAKE2b-256 |
7f1da85892ae4217ceb3f8ad74ec34b175d965be18b4b3136bca8d134d4aa41b
|
Provenance
The following attestation bundles were made for data_validation_gini-0.1.6-py3-none-any.whl:
Publisher:
publish-pypi.yml on ShanKonduru/data-validation-gini
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
data_validation_gini-0.1.6-py3-none-any.whl -
Subject digest:
903b8cd65250630a6474ee119140a05507f21b9c352c776a53b54cdf61b71ab8 - Sigstore transparency entry: 1553559753
- Sigstore integration time:
-
Permalink:
ShanKonduru/data-validation-gini@992ece7b10c72efed303ffc25d65a051725f733d -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/ShanKonduru
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@992ece7b10c72efed303ffc25d65a051725f733d -
Trigger Event:
push
-
Statement type: