CLI tool for comparing CSV files in git diff format
Project description
CSV Diff
CSV Diff is a CLI tool for comparing two CSV files and displaying the results in git diff style.
For example, there are two CSV files, districts-2022.csv and districts-2025.csv. With this tool, you can easily see the data differences between these two CSV files. The output will be saved as a .diff file, like this:
--- districts-2022.csv
+++ districts-2025.csv
@@ -7,9 +7,9 @@
11.01.07,11.01,Sawang
11.01.08,11.01,Tapaktuan
11.01.09,11.01,Trumon
-11.01.10,11.01,Pasi Raja
-11.01.11,11.01,Labuhan Haji Timur
-11.01.12,11.01,Labuhan Haji Barat
+11.01.10,11.01,Pasie Raja
+11.01.11,11.01,Labuhanhaji Timur
+11.01.12,11.01,Labuhanhaji Barat
11.01.13,11.01,Kluet Tengah
11.01.14,11.01,Kluet Timur
11.01.15,11.01,Bakongan Timur
@@ -141,7 +141,7 @@
11.08.11,11.08,Syamtalira Bayu
11.08.12,11.08,Tanah Luas
11.08.13,11.08,Tanah Pasir
-11.08.14,11.08,T. Jambo Aye
+11.08.14,11.08,Tanah Jambo Aye
11.08.15,11.08,Sawang
11.08.16,11.08,Nisam
11.08.17,11.08,Cot Girek
... (truncated)
To see the full differences, please check the
result.difffile.
Usage
csvdiff path/to/file1.csv path/to/file2.csv
Use
--helpto see the available options.
Installation
This package is available on PyPI.
You can install it as a standalone CLI application using pipx or uv.
Using pipx
pipx install csv-diff-py
csvdiff
Using uv
uv tool install csv-diff-py
csvdiff
or without installing globally, you can use uvx to run it directly:
uvx --from csv-diff-py csvdiff
Development Setup
Prerequisites
uvpackage manager- Python 3.9 or higher
Tip: You can use
uvto install Python. See the Python installation guide for more details.
Steps
-
Clone this repository
git clone https://github.com/fityannugroho/csv-diff.git cd csv-diff
-
Install dependencies
uv sync --all-extras
-
Run the tool locally
Via
uv:uv run csvdiff
Via virtual environment:
source .venv/bin/activate csvdiff
-
Run tests
uv run pytest
-
Run linter and formatter
uv run ruff check uv run ruff format
Limitations
- Only supports CSV files with a header row.
Project details
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 csv_diff_py-0.5.0.tar.gz.
File metadata
- Download URL: csv_diff_py-0.5.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6ee364905c40a9abe24d2b7e46c6346990712b442c0d20e19598c0f23f0486e
|
|
| MD5 |
5b4251ae0e33e4895554813f4c84bb13
|
|
| BLAKE2b-256 |
4da2717f6d1c293fe115f3c5068910360e4fd25696e58cf959b726b187b82779
|
Provenance
The following attestation bundles were made for csv_diff_py-0.5.0.tar.gz:
Publisher:
publish.yml on fityannugroho/csv-diff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
csv_diff_py-0.5.0.tar.gz -
Subject digest:
f6ee364905c40a9abe24d2b7e46c6346990712b442c0d20e19598c0f23f0486e - Sigstore transparency entry: 962642674
- Sigstore integration time:
-
Permalink:
fityannugroho/csv-diff@99784bc77e8523ddddac1ff98b68f2c3854f52bf -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/fityannugroho
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@99784bc77e8523ddddac1ff98b68f2c3854f52bf -
Trigger Event:
release
-
Statement type:
File details
Details for the file csv_diff_py-0.5.0-py3-none-any.whl.
File metadata
- Download URL: csv_diff_py-0.5.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c54b8805bf12873b88d3304e962e8cee6c9dfd2ac3521b29bb2ab87d1aec368
|
|
| MD5 |
7ae47bbe34b72872410cda0bf8ed1bf9
|
|
| BLAKE2b-256 |
1e90184a9e70aa9da4d6facc121185bd32ce2a1ed84db5c9c10e330cc676f33e
|
Provenance
The following attestation bundles were made for csv_diff_py-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on fityannugroho/csv-diff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
csv_diff_py-0.5.0-py3-none-any.whl -
Subject digest:
7c54b8805bf12873b88d3304e962e8cee6c9dfd2ac3521b29bb2ab87d1aec368 - Sigstore transparency entry: 962642685
- Sigstore integration time:
-
Permalink:
fityannugroho/csv-diff@99784bc77e8523ddddac1ff98b68f2c3854f52bf -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/fityannugroho
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@99784bc77e8523ddddac1ff98b68f2c3854f52bf -
Trigger Event:
release
-
Statement type: