Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

csv files printer

Project description

tbl - cat for csv files

tbl lets you print out csv files to your terminal, formatted and "prettified".

A lot of the hard work is done with the rapidtables package, check it out!

cat tbl

Check out this recorded example: asciicast

Requirements

  • Python 3.4+

Installation

pip install --user clitbl

Usage options

Use tbl -h / tbl --help to see help.

  • The most common use it to just print the table
tbl file.csv
  • --headers
    The headers options lets you explicitly specify the headers for the table. Use this option when you csv files does not include headers, (e.g exampleFile
tbl file.csv --headers '#Index#Item#Cost#Tax#Total'
  • --select
    The select options lets you select what columns to print (similar to SQL SELECT)
tbl file.csv --select '#Item#Tax'

:exclamation: Both headers and select use the first charcter as a separator, it can be any character (kinda like a sed expressions)
:exclamation: The headers specified with this option are case-sensitive
:star2: The headers and select headers can be used together

  • --format (defualt: rstgrid)
    The format options lets you specify the format used when printing the table.
    The available formats are:
rstgrid rst md simple

Restrictions

There are several cases tbl does not support:

  • Duplicated headers, all headers must be distinct
  • Very long headers, while tbl can wrap long paragraph of text in a cell, it cannot wrap text in the headers, which may lead to disfigured output

:exclamation: This is not the use case for tbl anyway, but dont try to print huge tables (several GBs), as tbl (and rapidtable) read the entire table to memory before printing

* Example csv were downloaded from here

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for clitbl, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size clitbl-0.0.1-py3-none-any.whl (5.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size clitbl-0.0.1.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page