skillfed

csv-diff

Python CLI tool and library for diffing CSV and JSON files

csv-diff v1.2 219.0K downloads/30d#9,331 on PyPI339
Permissive license Apache License, Version 2.0 DORMANT released

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-diff

uv

uv add csv-diff

poetry

poetry add csv-diff

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: End Users/DesktopIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7

Tags

csv file diff comparisoncompare two csv filesdetect csv changescsv data diffing tooljson array comparisontsv file differencesdata row changes
data-comparisoncli-tool

More Utilities packages