No project description provided
Project description
Pretty CSV Diff
pretty-csv-diff is a Python utility that compares two CSV files for differences. It highlights these differences by colorizing them and aligning the columns for easy visual comparison. This tool is particularly useful for data analysts and developers who work with large datasets and need to quickly identify changes between two versions of a CSV file.
Features
- Color-coded output for easy spotting of differences.
- Column alignment for improved readability.
- Command-line interface for easy integration with other tools or scripts.
- Supports specifying multiple primary keys for comparison.
Installation
To install pretty-csv-diff, clone the repository and run the setup script:
git clone https://github.com/eternity8/pretty-csv-diff.git
cd pretty-csv-diff
pip install .
Usage
The basic command-line syntax for pretty-csv-diff is:
pretty-csv-diff [options] path1 path2 [primary_key ...]
path1andpath2are the file paths to the two CSV files you want to compare.primary_keyis either the name or the index of the primary key column(s) in the CSV files. You can specify multiple columns for composite keys.
Example
To compare two CSV files old.csv and new.csv using the column id as the primary key:
pretty-csv-diff old.csv new.csv id
This will output the differences between the two files in your terminal, with < indicating rows that are only in old.csv and > indicating rows that are only in new.csv. Rows present in both files but with differences will be shown side by side for comparison.
Command-Line Example Screenshot
Command-Line Usage
usage: pretty-csv-diff [-h] path path pk [pk ...]
positional arguments:
path paths to the two csv files to be compared
pk name or index of primary key column. multiple columns are
allowed
optional arguments:
-h, --help show this help message and exit
Contributing
Contributions to pretty-csv-diff are welcome.
License
pretty-csv-diff is released under the Apache License, Version 2.0 (January 2004). See the LICENSE file for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pretty-csv-diff-0.1.0.tar.gz.
File metadata
- Download URL: pretty-csv-diff-0.1.0.tar.gz
- Upload date:
- Size: 340.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
727e2b2da8b2a6eb5e3b162c341e3c8644129e2c26496055f6f70d356325fa72
|
|
| MD5 |
51a5c8a1038a0afdc07e180c4a0caf5a
|
|
| BLAKE2b-256 |
aa59d620c961c6201e0f7c5db686fe56788db593588c13cf02767f51c6836868
|