About¶ 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. Important links: Repository: https://github.com/onyxfish/csvkit

Issues: https://github.com/onyxfish/csvkit/issues

Documentation: http://csvkit.rtfd.org/

Schemas: https://github.com/onyxfish/ffs

Buildbot: https://travis-ci.org/onyxfish/csvkit

Principles¶ 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. Small is beautiful. Make each program do one thing well. Build a prototype as soon as possible. Choose portability over efficiency. Store data in flat text files. Use software leverage to your advantage. Use shell scripts to increase leverage and portability. Avoid captive user interfaces. Make every program a filter. As there is no formally defined CSV format, csvkit encourages well-known formatting standards: Output favors compatability with the widest range of applications. This means that quoting is done with double-quotes and only when necessary, columns are separated with commas, and lines are terminated with unix style line endings (“

”).

Data that is modified or generated will prefer consistency over brevity. Floats always include at least one decimal place, even if they are round. Dates and times are written in ISO8601 format.

Installation¶ Users¶ If you only want to use csvkit, install it this way: pip install csvkit If you are installing on Ubuntu you may need to install the Python development headers prior to install csvkit: sudo apt - get install python - dev python - pip python - setuptools build - essential If the installation appears to be successful but running the tools fails, try updating your version of Python setuptools: pip install setuptools -- upgrade pip install csvkit -- upgrade Note 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, 3.3, 3.4 and PyPy. Neither Python < 2.6 nor Python < 3.3 are supported at this time. Developers¶ If you are a developer that also wants to hack on csvkit, install it this way: git clone git : // github . com / onyxfish / csvkit . git cd csvkit mkvirtualenv -- no - site - packages csvkit # If running Python 2 pip install - r requirements - py2 . txt # If running Python 3 pip install - r requirements - py3 . txt python setup . py develop tox Note If you are using Python2 and have a recent version of pip, you may need to run pip with the additional arguments --allow-external argparse .

Using as a library¶ csvkit is designed to be used a replacement for most of Python’s csv module. Important parts of the API are documented on the following pages. Don’t! import csv Do! import csvkit csvkit

csvkit.unicsv

csvkit.sniffer

Authors¶ The following individuals have contributed code to csvkit: Christopher Groskopf

Joe Germuska

Aaron Bycoffe

Travis Mehlinger

Alejandro Companioni

Benjamin Wilson

Bryan Silverthorn

Evan Wheeler

Matt Bone

Ryan Pitts

Hari Dara

Jeff Larson

Jim Thaxton

Miguel Gonzalez

Anton Ian Sipos

Gregory Temchenko

Kevin Schaul

Marc Abramowitz

Noah Hoffman

Jan Schulz

Derek Wilson

Chris Rosenthal

Davide Setti

Gabi Davar

Sriram Karra

James McKinney

aarcro

Matt Dudys

Joakim Lundborg

Federico Scrinzi

Chris Rosenthal

Shane StClair

raistlin7447

Alex Dergachev

Jeff Paine

Jeroen Janssens

Sébastien Fievet

Travis Swicegood

Ryan Murphy

Diego Rabatone Oliveira

Matt Pettis

Tasneem Raja

Richard Low

Kristina Durivage

Espartaco Palma

pnaimoli

Michael Mior

License¶ The MIT License Copyright (c) 2014 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.