Skip to main content
![PyPI](https://img.shields.io/pypi/v/diffcsv.svg) [![Build Status](https://travis-ci.org/ugursogukpinar/diff-csv.svg?branch=master)](https://travis-ci.org/ugursogukpinar/diff-csv)

# diffcsv

It finds differences between two version of a csv file which are built with same structure.

### Requirements
---

- Python 3.x

### Setup
---

```
$ pip install diffcsv
```


### Usage
---

```
diffcsv [-h] [--primary-key PRIMARY_KEY]
[--based-on BASED_ON [BASED_ON ...]] [--delimiter DELIMITER]
old_csv new_csv

positional arguments:
old_csv Path of old csv file
new_csv Path of new csv file

optional arguments:
-h, --help show this help message and exit
--primary-key PRIMARY_KEY
Common key of two csv files
--based-on BASED_ON [BASED_ON ...]
--delimiter DELIMITER
Delimiter of csv files
```

Example:

- version-1.csv
```
id,key,value,created_at
1,key-1,value-1,2018-01-01
2,key-2,value-2,2018-02-01
```

- version-2.csv
```
id,key,value,created_at
1,key-1,value-1-altered,2018-01-01
3,key-3,value-3,2018-02-02
```


Run:

```bash
$ diffcsv /path/of/version-1.csv /path/of/version-2.csv --primary-key id --based-on key value
```

Output:
```
"id","key","value","created_at","DIFF_STATUS"
"2","key-2","value-2","2018-02-01","DELETED"
"3","key-3","value-3","2018-02-02","INSERTED"
"1","key-1","value-1-altered","2018-01-01","UPDATED"
```


### Contributers
[**Kaan ant**](https://github.com/kaanant)

Release files for diffcsv 1.6

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

Source distribution (sdist)

Source distribution for diffcsv 1.6
File Size Uploaded
diffcsv-1.6.tar.gz 16.6 kB Details

Release files / diffcsv-1.6.tar.gz

Download URL diffcsv-1.6.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9749da2d55fe48eba7a300bbbf0389c20ed0cd6b7bdf1c07869116dcf14b141b
BLAKE2b-256 checksum
How to use checksums
97679cd22e97c50afccbfd90695fb6c7c8756b1f3723159f39f1a8fd697fc9d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Release history Release notifications | RSS feed

1.7

1 release file

This release

1.6 This release

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

2 release files

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