Skip to main content

compara

CI Crates.io PyPI License: MIT Documentation

Extremely fast table comparison: two tables on a composite key, with counts, per-column statistics and a self-contained HTML report. One tool for every recurring comparison: a nightly export against yesterday's, a CSV against the Parquet a warehouse emits, a migration's source against its target.

Faster software for a better planet — less energy, less compute, more time for life.

  • Reads CSV, TSV, JSON (newline-delimited or one array of objects) and Parquet, and the two sides need not be in the same format.
  • Ten million rows × 20 columns in about a second on four cores, CSV or Parquet (benchmarks).
  • Reads and writes object storage and the web directly (s3://, gs://, az://, https://), with each cloud's own credentials, and fetches only the Parquet columns it compares (object storage).
  • One static binary, and a distroless container image; the report is a single HTML file with nothing to host.
  • Exit codes made for pipelines: 0 identical, 1 differences, 2 error, 3 duplicate keys (with --fail-on-dups).

Install

Prebuilt binaries for Linux (x86_64, aarch64), macOS (arm64, x86_64) and Windows (x64) are on the releases page, and the same binaries through package managers:

Channel Command
Cargo cargo install --locked compara
pip / uv pip install compara · uv tool install compara
Homebrew brew install andrey-usa/tap/compara
Scoop scoop bucket add andrey-usa https://github.com/andrey-usa/scoop-bucket then scoop install compara
Docker docker run --rm -v "$PWD:/data" ghcr.io/andrey-usa/compara compare a.csv b.csv -k id

Quick start

$ compara compare examples/orders_2026-08.csv examples/orders_2026-09.csv -k order_id,line_no -i updated_at
A 800 rows | B 799 rows | matched 787 (changed 102) | added 10 | removed 12 | duplicate keys A 1, B 1 | engine turbo, 0.011s
note: column only in B, not compared: carrier
$ echo $?
1
$ compara compare examples/orders_2026-08.csv examples/orders_2026-09.csv -k order_id,line_no -i updated_at -o report.html
A 800 rows | B 799 rows | matched 787 (changed 102) | added 10 | removed 12 | duplicate keys A 1, B 1 | engine turbo, 0.001s
Report: report.html (20 KB)
note: column only in B, not compared: carrier

Two monthly order exports from the repository's examples/, keyed on (order_id, line_no), with updated_at left out. Exit code 1 says they differ; the report holds the counts, per-column statistics and the changed, added, removed and duplicate rows. The note names a column only one of the files has: it is not compared, and it does not change the exit code. More: Everyday comparisons, and every option of compare: compare options.

For AI agents

  • Skill: compara skill prints the guide an agent reads to use this version of compara.
  • Machine-readable result: --json summary.json (or --json - for standard output) writes the counts and per-column statistics, in the shape docs/contract.schema.json gives.
  • Exit codes: 0 identical, 1 differences, 2 error, 3 duplicate keys with --fail-on-dups; --exit-zero for a job whose output is the report.
  • Read-only by default: compare without -o, --json or --export-dir writes nothing; --summary makes that a promise and refuses any flag that would write.
  • Docs as markdown: llms.txt lists every page of the docs site, each one also served as .md.

The loop an agent runs: compara columns on each file to choose the key, compare --summary for the counts, then --json - for the columns that changed and --export-dir for the rows.

Benchmarks

Two tables of 20 columns compared on a composite key (-k account_id,txn_id -i updated_at), every tool's unchanged, changed, added and removed counts checked identical, on GitHub's ubuntu-24.04, image 20261111.127.1 (Intel(R) Xeon(R) 6975P-C, 4 cores, 15 GB), bench-contenders run 43794429051, 2026-11-16:

input, both files compara 0.6.1 DuckDB 2.0.0 Polars 2.1.0 qsv 29.0.0
1M rows, CSV, 368 MB 0.09 s · 0.3 s · 411 MB 2.29 s · 6.3 s · 1,080 MB 2.25 s · 8.8 s · 2,364 MB 0.78 s · 2.0 s · 145 MB
1M rows, Parquet, 161 MB 0.13 s · 0.4 s · 322 MB 1.26 s · 2.1 s · 1,167 MB 2.27 s · 7.9 s · 2,382 MB not run
10M rows, CSV, 3,679 MB 0.84 s · 2.8 s · 4,030 MB 17.16 s · 64.6 s · 8,793 MB out of memory after 10 s, at 13,341 MB 8.31 s · 22.1 s · 1,008 MB
10M rows, Parquet, 1,609 MB 1.06 s · 3.5 s · 2,730 MB 7.25 s · 26.8 s · 7,142 MB out of memory after 9 s, at 13,342 MB not run

Each cell: wall time, best of 3 · CPU time (user and system) · peak memory, of the best run; fastest in bold. DuckDB and Polars run from Python, and their time starts at their first read, after the interpreter's start and the import; qsv is a binary and is timed as a whole process, like compara, runs on CSV only, and is given the files with the ignored column and the repeated keys already taken out (the page says how). A tool the runner's kernel stopped for lack of memory says so.

Where another tool did better in this run (by more than 2%): peak memory on 1M rows, CSV, 368 MB: qsv 145 MB, compara 411 MB; peak memory on 10M rows, CSV, 3,679 MB: qsv 1,008 MB, compara 4,030 MB.

The method, every run and object storage: Benchmarks.

Documentation

The docs site, https://andrey-usa.github.io/compara/, has the same parts for every tool:

For agents: llms.txt lists every page as markdown, and llms-full.txt is the whole site in one file.

Contributing

Building, testing and the performance gate: CONTRIBUTING.md.

License

MIT: LICENSE.

Metadata

Release files for compara 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for compara 0.7.0
File Actions
compara-0.7.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for compara-0.7.0-py3-none-win_amd64.whl
compara-0.7.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for compara-0.7.0-py3-none-manylinux_2_28_x86_64.whl
compara-0.7.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for compara-0.7.0-py3-none-manylinux_2_28_aarch64.whl
compara-0.7.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for compara-0.7.0-py3-none-macosx_11_0_arm64.whl
compara-0.7.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for compara-0.7.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 25.0 MB

Release files / compara-0.7.0-py3-none-win_amd64.whl

Download URL compara-0.7.0-py3-none-win_amd64.whl
Size 5.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
abbc67d820fc12861198b7246748fbe64a3c7744fb9328a3f61405f4cbfbb8a9
BLAKE2b-256 checksum
How to use checksums
f3a9bf9390cc936790370983fbb5dc7b84db56472aec35e9d27ab372fd0d6dbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / compara-0.7.0-py3-none-manylinux_2_28_x86_64.whl

Download URL compara-0.7.0-py3-none-manylinux_2_28_x86_64.whl
Size 5.2 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
691122d840e2b2390f2a58bb7153a067bfcef5fc593d72ee8153b292cfbff06c
BLAKE2b-256 checksum
How to use checksums
2aa8970a94aa83af10c076df0d7cba751276294409ec5f534a75b6dc69eec403
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / compara-0.7.0-py3-none-manylinux_2_28_aarch64.whl

Download URL compara-0.7.0-py3-none-manylinux_2_28_aarch64.whl
Size 4.8 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
e7bb67af62039601604e62a38378255be3a8353f65bc627be241ca268d1dd44b
BLAKE2b-256 checksum
How to use checksums
d5287ed4e7cdf7ccab39b1c7f761d7e91e161ddc6b574945d59e97ac23934280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / compara-0.7.0-py3-none-macosx_11_0_arm64.whl

Download URL compara-0.7.0-py3-none-macosx_11_0_arm64.whl
Size 4.5 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4c9998c720a27100caeae7379794f4d370e03281aa56cdd3db6534deb8142548
BLAKE2b-256 checksum
How to use checksums
304bef2390842cc56f1cb36b1230a4558f469adf95d203bc4c6c4291a1646a6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / compara-0.7.0-py3-none-macosx_10_12_x86_64.whl

Download URL compara-0.7.0-py3-none-macosx_10_12_x86_64.whl
Size 5.4 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f9d0a52f081a36a2b5b88a91f9a058bac4f4b516250e31adbe0766d0779b0cd2
BLAKE2b-256 checksum
How to use checksums
772df4d016bc9a36276da046b0ea062861871aaf4e3a9dc58262b37d8736a409
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for compara 0.7.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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for compara-0.7.0-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page