Skip to main content

Find difference between two large csv files

Project description

![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)

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

diffcsv-1.7.tar.gz (16.6 kB view details)

Uploaded Source

File details

Details for the file diffcsv-1.7.tar.gz.

File metadata

  • Download URL: diffcsv-1.7.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for diffcsv-1.7.tar.gz
Algorithm Hash digest
SHA256 5842d64eb6731652539dab74a9a96ff3a547efcb66a0497ee113870f4a498132
MD5 3f30aa4acd6309f03dcf5ec3bbb03187
BLAKE2b-256 93544bdd50eee196ed913d8ef8599c1fcab44f720232ebde9527dce55d72a57c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page