Compare CSV and TSV reruns

Match rows by the columns that identify them. Check whether a rerun changed their values beyond the tolerance you set.

Two reruns under one contract

These synthetic tables share three row keys. Follow reference, 2 in the original table and both reruns.

Pass Exit 0

Rows and columns reordered

The key still matches. The estimate changes by less than the allowed difference.

Baseline
0.410
Rerun
0.413
Change
0.003

Allowed difference 0.00510

3 matched rows 0 differences

Fail Exit 1

An estimate drifted

The key still matches. Its estimate exceeds the tolerance recorded in the contract.

Baseline
0.410
Rerun
0.450
Change
0.040

Allowed difference 0.00510

3 matched rows 1 difference

The allowed difference is atol + rtol × |baseline|. The report downloads contain the unedited CLI output from version 0.4.0.

Install v0.4.0

Choose the Conda environment or the released Python wheel.

Conda-forge

conda create --name table-check --override-channels -c conda-forge/label/main table-contract-check=0.4.0
conda activate table-check
If Conda cannot find the package

The command uses the explicit main label. Package listings and the index a solver uses can update at different times. Check the index with the same channel and version.

conda search --override-channels -c conda-forge/label/main table-contract-check=0.4.0

The released wheel is an alternative when the index has no match. See the recorded index comparison.

Python 3.11+

python -m pip install https://github.com/vxxqv/table-contract-check/releases/download/v0.4.0/table_contract_check-0.4.0-py3-none-any.whl

The wheel has no runtime dependencies.

Run both checks locally

Unzip the example files and run these commands in the extracted folder.

table-contract-check contract.toml baseline.csv rerun.csv --format json
table-contract-check contract.toml baseline.csv drift.csv --format json

Exit 0 means pass, 1 means differences were found, and 2 means there is an input error.

Start a contract for your own table

Replace these key, numeric, and ignored columns with the ones you need. The starter contract uses zero tolerance. Set your intended tolerance before using the checker as a release gate.

table-contract-check --init baseline.csv --key scenario --key replicate --numeric estimate --ignore run_id --output starter.toml

Require a minimum number of shared keys or use it in CI.