csvkit is a suite of utilities for converting to and working with CSV, the king of tabular file formats.
It is inspired by pdftk, gdal and the original csvcut utility by Joe Germuska and Aaron Bycoffe.
csvkit is to tabular data what the standard Unix text processing suite (grep, sed, cut, sort) is to text. As such, csvkit adheres to the Unix philosophy.
As there is no formally defined CSV format, csvkit encourages well-known formatting standards:
pip install csvkit
git clone git://github.com/onyxfish/csvkit.git cd csvkit mkvirtualenv --no-site-packages csvkit pip install -r requirements.txt python setup.py develop nosetests
csvkit is routinely tested on OSX, somewhat less frequently on Linux and once in a while on Windows. All platforms are supported. It is tested against Python 2.6, 2.7 and PyPy. Neither Python < 2.6 nor Python >= 3.0 are supported at this time.
The csvkit tutorial walks through processing and analyzing a real dataset from data.gov. It is divided into several parts for easier reading:
csvkit is comprised of a number of individual command line utilities that be loosely divided into a few major categories: Input, Processing, and Output. Documentation and examples for each utility are described on the following pages.
Output (and Analysis)
csvkit is designed to augment or supercede much of Python’s csv module. Important parts of the API are documented here:
Want to hack on csvkit? Here’s how:
The MIT License
Copyright (c) 2013 Christopher Groskopf and contributers
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.