Skip to content

Instantly share code, notes, and snippets.

@pauldougan
Last active October 1, 2022 07:16
Show Gist options
  • Save pauldougan/caf48156b75fbc4e83d40739e1611ca6 to your computer and use it in GitHub Desktop.
Save pauldougan/caf48156b75fbc4e83d40739e1611ca6 to your computer and use it in GitHub Desktop.
some csv tools

CSV tools - a partial list

I tend to wrangle a lot of spreadsheet data but don't always want to use use google sheets and habitually convert to csv and process them locally.

This is a list of some of my favourite tools, its non exhaustive and biased towards my preference for terminal based user interfaces

1. visidata - the swiss army tool for tabular data

https://www.visidata.org/

if you install one tool this is the one

  • handles many formats, json, yaml, xlsx, parquet, sqlite, postgresql, zip
  • pythonic
  • extensible
  • fast
  • reliable
  • handle multitab excel files
  • can open a zipfile containing json, csv, json, yaml ...

assumes you have python3, has a bit of a learning curve because of all the key mappings but there is a menu system.

pip3 install visidata
vd foo.bar

2. csvkit - command line unix style csv tools

https://csvkit.readthedocs.io/en/latest/

command line tools for unix style wrangling with csvgrep, csvcut, csvsort, csvlook, csvjoin

  • convert json, xlsx to csv
  • filter, join, format, stack files

assumes python 3

pip3 install csvkit

3. xsv - rust command line tool for csv wrangling

https://github.com/BurntSushi/xsv

xsv is a command line program for indexing, slicing, analyzing, splitting and joining CSV files

if your data is too big for csvkit try this

brew install xsv

4. steampipe - wrangle cloud apis and local data with sql

https://steampipe.io

  • turns a wealth of cloud apis into postgres SQL
  • dozens of plugins
  • makes csv available to postgres
  • supports third party tools like pgadmin, psql

Uses a pluggable Postgres foreign data wrapper to process data csv, json, yaml but also AWS, Azure, prometheus etc

brew install steampipe
steampipe plugin install csv
steampipe query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment