csv-diff
Python CLI tool and library for diffing CSV and JSON files
What it is and what it does
csv-diff is a command-line tool and Python library that identifies and reports differences between two structured data files (CSV, TSV, or JSON arrays). It treats one column as a unique key to match records across files, then reports which rows were added, removed, or changed, and which specific fields changed within each row.
You can use it as a CLI tool to get a human-readable summary or JSON output, or import its functions into your own Python code to programmatically compare datasets. It automatically detects delimiter format (comma or tab) and can augment the output with templated extras like URLs. The package is lightweight, depending only on click and dictdiffer.
Use it for:
- Track changes to a public dataset over time and generate a commit log of what changed between versions
- Audit data migrations by comparing source and target CSV exports to verify all records were moved correctly
- Monitor configuration or inventory files in version control by diffing snapshots to see what was added, removed, or modified
- Validate ETL pipelines by comparing expected and actual output files row-by-row
- Generate reports on data quality issues by comparing two versions of a dataset and highlighting specific field changes
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Compares two CSV, TSV, or JSON files and reports what rows were added, removed, or changed, with output as human-readable text or machine-readable JSON.
Yes, if you need to diff CSV or JSON files programmatically or from the command line. The package is stable, has no known vulnerabilities, and requires minimal dependencies. The dormant maintenance status is not a concern for a tool with a narrow, well-defined scope—it does one thing reliably and hasn't needed updates. Install it if this is your use case; skip it if you need active development or advanced diffing features.
Install
csv-diff on PyPI
pip
pip install csv-diffuv
uv add csv-diffpoetry
poetry add csv-diffInstalling csv-diff
Before you install
Low friction: pure Python wheel with only two runtime dependencies (click and dictdiffer). Maintenance is dormant—last release was 707 days ago—but the repo remains active and the package is stable enough for its narrow scope.
License in practice
Apache License 2.0 (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install csv-diff
from csv_diff import load_csv, compare
diff = compare(
load_csv(open("one.csv"), key="id"),
load_csv(open("two.csv"), key="id")
)
print(diff)
Verify before relying
- Whether the package works with Python versions beyond 3.6 and 3.7 (classifiers list only those two, but requires_python is unspecified)
Package facts
| License | Apache License, Version 2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — click, dictdiffer |
| Maintenance | dormant — 707 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 218,958/month — #9,331 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: csv_diff-1.2-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
collate-data-diffCompares rows across two SQL databases or…
permissive · top 5,000 on PyPI
daffCompares two tables and produces a diff summary…
permissive · top 1,000 on PyPI
diff-parserParses git diff and .diff files to extract…
permissive · top 15,000 on PyPI
linear-tsvParses and writes tabular data in Linear TSV…
permissive · top 15,000 on PyPI
detect-delimiterDetects the delimiter character used in CSV,…
permissive · top 15,000 on PyPI
pyjsonCompares the similarity between two JSON files…
permissive · top 15,000 on PyPI
recursive-diffRecursively compares two Python data structures…
permissive · top 15,000 on PyPI
datadiffGenerates human-readable diffs of Python data…
permissive · top 15,000 on PyPI
pycoberturaParses Cobertura code coverage reports and…
permissive · top 15,000 on PyPI
deepdiffDeepDiff compares dictionaries, iterables,…
permissive · top 1,000 on PyPI