From 78b918c4f406e64e35df6c091503fc89f3563f3b Mon Sep 17 00:00:00 2001 From: Niru Maheswaranathan Date: Tue, 3 May 2016 19:25:40 -0700 Subject: [PATCH] Adds a 'block' style --- README.md | 1 + tableprint.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a67f5c2..5f35257 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ Hosted at Read The Docs: [tableprint.readthedocs.org](http://tableprint.readthed - `numpy` ## Version +- 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 diff --git a/tableprint.py b/tableprint.py index 131993d..9423603 100644 --- a/tableprint.py +++ b/tableprint.py @@ -18,7 +18,7 @@ import sys import numpy as np __all__ = ['table', 'header', 'row', 'hr', 'top', 'bottom', 'banner', 'dataframe', 'humantime'] -__version__ = '0.3.2' +__version__ = '0.4.0' # set up table styles LineStyle = namedtuple('LineStyle', ('begin', 'hline', 'sep', 'end')) @@ -54,6 +54,12 @@ DEFAULT_STYLES = { bottom=LineStyle("╘", "═", "╧", "╛"), row=LineStyle('│', '', '│', '│'), ), + 'block': TableStyle( + top=LineStyle('◢', '■', '■', '◣'), + below_header=LineStyle(' ', '━', '━', ' '), + bottom=LineStyle('◥', '■', '■', '◤'), + row=LineStyle(' ', '', ' ', ' '), + ), } STYLE = 'round' WIDTH = 11