https://csvkit.readthedocs.io/en/latest/ csvkit latest [ ] * Tutorial * Reference * Tips and Troubleshooting * Contributing to csvkit * Release process * License * Changelog csvkit * Docs >> * csvkit 1.0.6 * Edit on GitHub --------------------------------------------------------------------- csvkit 1.0.6P AboutP Build status Coverage Status PyPI downloads Version License Support Python versions csvkit is a suite of command-line tools for converting to and working with CSV, the king of tabular file formats. It is inspired by pdftk, GDAL and the original csvcut tool by Joe Germuska and Aaron Bycoffe. Important links: * Documentation: https://csvkit.rtfd.org/ * Repository: https://github.com/wireservice/csvkit * Issues: https://github.com/wireservice/csvkit/issues * Schemas: https://github.com/wireservice/ffs First time? See Tutorial. Note To change the field separator, line terminator, etc. of the output, you must use csvformat. Note csvkit, by default, sniffs CSV formats (it deduces whether commas, tabs or spaces delimit fields, for example), and performs type inference (it converts text to numbers, dates, booleans, etc.). These features are useful and work well in most cases, but occasional errors occur. If you don't need these features, set --snifflimit 0 ( -y 0) and --no-inference (-I). Note If you need to do more complex data analysis than csvkit can handle, use agate. If you need csvkit to be faster or to handle larger files, you may be reaching the limits of csvkit. Consider loading the data into SQL, or using xsv. Why csvkit?P Because it makes your life easier. Convert Excel to CSV: in2csv data.xls > data.csv Convert JSON to CSV: in2csv data.json > data.csv Print column names: csvcut -n data.csv Select a subset of columns: csvcut -c column_a,column_c data.csv > new.csv Reorder columns: csvcut -c column_c,column_a data.csv > new.csv Find rows with matching cells: csvgrep -c phone_number -r "555-555-\d{4}" data.csv > new.csv Convert to JSON: csvjson data.csv > data.json Generate summary statistics: csvstat data.csv Query with SQL: csvsql --query "select name from data where age > 30" data.csv > new.csv Import into PostgreSQL: csvsql --db postgresql:///database --insert data.csv Extract data from PostgreSQL: sql2csv --db postgresql:///database --query "select * from data" > new.csv And much more... Table of contentsP * Tutorial + 1. Getting started o 1.1. About this tutorial o 1.2. Installing csvkit o 1.3. Getting the data o 1.4. in2csv: the Excel killer o 1.5. csvlook: data periscope o 1.6. csvcut: data scalpel o 1.7. Putting it together with pipes o 1.8. Summing up + 2. Examining the data o 2.1. csvstat: statistics without code o 2.2. csvgrep: find the data you need o 2.3. csvsort: order matters o 2.4. Summing up + 3. Power tools o 3.1. csvjoin: merging related data o 3.2. csvstack: combining subsets o 3.3. csvsql and sql2csv: ultimate power o 3.4. Summing up + 4. Going elsewhere with your data o 4.1. csvjson: going online o 4.2. csvpy: going into code o 4.3. csvformat: for legacy systems o 4.4. Summing up * Reference + Input o in2csv o sql2csv + Processing o csvclean o csvcut o csvgrep o csvjoin o csvsort o csvstack + Output and Analysis o csvformat o csvjson o csvlook o csvpy o csvsql o csvstat + Common arguments o Arguments common to all tools * Tips and Troubleshooting + Tips o Reading compressed CSVs o Specifying STDIN as a file + Troubleshooting o Installation o CSV formatting and parsing o CSV data interpretation o Slow performance o Database errors o Python standard output encoding errors * Contributing to csvkit + Getting Started + Principles of development + How to contribute + A note on new tools + Streaming versus buffering + Legalese * Release process * License * Changelog + 1.0.6 - July 13, 2021 + 1.0.5 - March 2, 2020 + 1.0.4 - March 16, 2019 + 1.0.3 - March 11, 2018 + 1.0.2 - April 28, 2017 + 1.0.1 - December 29, 2016 + 1.0.0 - December 27, 2016 + 0.9.1 - March 31, 2015 + 0.9.0 - September 8, 2014 + 0.8.0 - July 27, 2014 + 0.7.3 - April 27, 2014 + 0.7.2 - March 24, 2014 + 0.7.1 - March 24, 2014 + 0.7.0 - March 24, 2014 + 0.6.1 - August 20, 2013 + 0.6.0 - August 20, 2013 + 0.5.0 - August 21, 2012 + 0.4.4 - May 1, 2012 + 0.4.3 - February 20, 2012 CitationP When citing csvkit in publications, you may use this BibTeX entry: @Manual{, title = {csvkit}, author = {Christopher Groskopf and contributors}, year = 2016, url = {https://csvkit.readthedocs.org/} } AuthorsP 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 * Aaron McMillin * Matt Dudys * Joakim Lundborg * Federico Scrinzi * Shane StClair * raistlin7447 * Alex Dergachev * Jeff Paine * Jeroen Janssens * Sebastien Fievet * Travis Swicegood * Ryan Murphy * Diego Rabatone Oliveira * Matt Pettis * Tasneem Raja * Richard Low * Kristina Durivage * Espartaco Palma * pnaimoli * Michael Mior * Jennifer Smith * Antonio Lima * Dave Stanton * Pedrow * Neal McBurnett * Anthony DeBarros * Baptiste Mispelon * James Seppi * Karrie Kehoe * Geert Barentsen * Cathy Deng * Eric Brechemier * Neil Freeman * Fede Isas * Patricia Lipp * Kev++ * edwardros * Martin Burch * Pedro Silva * hydrosIII * Tim Wisniewski * Santiago Castro * Dan Davison * Eric Araujo * Sam Stuck * Edward Betts * Jake Zimmerman * Bryan Rankin * Przemek Wesolek * Karl Fogel * sterlingpetersen * kjedamzik * John Vandenberg * Olivier Lacan * Adrien Delessert * Ghislain Antony Vaillant * Forest Gregg * Aliaksei Urbanski * Reid Beels * Rodrigo Lemos * Victor Noagbodji * Connor McArthur * Matej Cepl * Nicholas Matteo * Matt Giguere * Felix Bunemann * Andriy Orehov (Andrii Oriekhov) * Dan Nguyen * Tan Jiu Ding * Tomas Hrnciar * Christopher Bottoms * panolens * Gabe Walker Indices and tablesP * Index * Module Index * Search Page Next --------------------------------------------------------------------- (c) Copyright 2016, Christopher Groskopf Revision 278a67b2. Built with Sphinx using a theme provided by Read the Docs. Read the Docs v: latest Versions latest 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0 0.9.2 0.9.1 0.9.0 Downloads html On Read the Docs Project Home Builds --------------------------------------------------------------------- Free document hosting provided by Read the Docs.