Niru Maheswaranathan 5a20c7d781 Merge pull request #2 from nirum/variable_width
Adds support for variable widths across columns
2017-05-25 15:29:03 -07:00
2016-05-03 23:14:30 -07:00
2017-05-18 01:23:23 -07:00
2016-05-03 22:58:26 -07:00
2016-05-03 23:08:43 -07:00
2017-05-25 15:10:56 -07:00
2017-05-25 15:07:49 -07:00

tableprint

Pretty console printing 📋 of tabular data in python 🐍

Build Status Coverage Status Documentation Status PyPi version

About

tableprint lets you easily print formatted tables of data. Unlike other modules, you can print single rows of data at a time (useful for printing ongoing computation results).

Example output

Table of Contents

Installation

pip install tableprint

Usage

The tableprint.table function takes in a matrix of data, a list of headers, a width (defaults to 11) and a style (defaults to 'round'). To print a dataset consisting of 10 rows of 3 different columns with the default width and style:

import tableprint
import numpy as np

data = np.random.randn(10, 3)
headers = ['Column A', 'Column B', 'Column C']

tableprint.table(data, headers)

The header and row functions allow you to print just the header or just a row of data, respectively, which is useful for continuously updating a table during a long-running computation. Also, the banner function is useful for just printing out a nicely formatted message to the user.

Documentation

Hosted at Read The Docs: tableprint.readthedocs.org

Dependencies

  • Python 2.7 or 3.3+
  • numpy
  • six

Version

  • 0.6.9 (May 25 2017) Splitting the tableprint.py module into a pacakge with multiple files
  • 0.6.7 (May 25 2017) Fixes some bugs with ANSI escape sequences
  • 0.5.0 (Sept 29 2016) Better handling of ANSI escape sequences in table rows
  • 0.4.0 (May 3 2016) Adds a 'block' style
  • 0.3.2 (May 3 2016) Adds a test suite
  • 0.3.0 (May 3 2016) Adds custom styles for tables, specified by a key ('fancy_grid', 'grid', etc.)
  • 0.2.0 (May 2 2016) Adds better python2 (unicode/bytes) compatibility
  • 0.1.5 (Oct 1 2015) Renamed hrtime to humantime, added docs
  • 0.1.4 (Sept 28 2015) Added human readable string converter (hrtime)
  • 0.1.0 (Feb 24 2015) Initial release

License

MIT. See LICENSE.md

Description
Pretty console printing 📋 of tabular data in python 🐍
Readme 485 KiB
Languages
Python 98.2%
Makefile 1.8%