Giter Site home page Giter Site logo

kaanant / diff-csv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ugursogukpinar/diff-csv

0.0 2.0 0.0 41 KB

It takes difference between two version of large csv files.

License: GNU General Public License v3.0

Makefile 6.91% Python 93.09%

diff-csv's Introduction

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:

$ 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"

diff-csv's People

Contributors

ugursogukpinar avatar

Watchers

James Cloos avatar Kaan Ant avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.