This Python package provides an assortment of command-line tools to manipulate csv-formatted data. The tools are:
csv2jsonl: converts csv input into jsonlinescsvaddrandom: adds a column with a random numbercsvadduniqueid: adds a column with a unique record identifiercsvaggregate: applies an arbitrary Python function to every value of a column, possibly within groupscsvappend: appends two or more csv filescsvdropdups: drops duplicate recordscsvfindsortkey: attempts to find the column that the input is sorted bycsvkeepmax: keeps the record that has the maximum value in a columncsvleftjoin: merges two csv filescsvop: applies an arbitrary Python function to every record and saves the return value in a new columncsvparallel: parallelizes arbitrary commands that read a csv input and write a csv outputcsvrename: changes the name of a columncsvreorder: changes the order of columnscsvsed: applies a substitution rule, using regular expressions, to every value of a columncsvsort: sorts the inputcsvtranspose: transposes the inputfw2csv: converts fixed-width input, potentially with multi-line records, into csvlongcsv2wide: converts the input from long to wide formwidecsv2long: converts the input from wide to long form
To install this package using pip, type
pip install git+https://github.com/gn0/sacsv
or, alternatively,
git clone https://github.com/gn0/sacsv
pip install ./sacsv
Gabor Nyeki. Contact information is on http://www.gabornyeki.com/.
This package is licensed under the Creative Commons Attribution 4.0 International License: http://creativecommons.org/licenses/by/4.0/.