Easily draw tables in terminal/console applications from a list of lists of strings. Supports multi-line rows.
- Python 2.6, 2.7, PyPy, PyPy3, 3.3, 3.4, and 3.5 supported on Linux and OS X.
- Python 2.7, 3.3, 3.4, and 3.5 supported on Windows (both 32 and 64 bit versions of Python).
📖 Full documentation: https://robpol86.github.io/terminaltables
Install:
pip install terminaltables
Usage:
from terminaltables import AsciiTable
table_data = [
['Heading1', 'Heading2'],
['row1 column1', 'row1 column2'],
['row2 column1', 'row2 column2'],
['row3 column1', 'row3 column2']
]
table = AsciiTable(table_data)
print table.table
+--------------+--------------+
| Heading1 | Heading2 |
+--------------+--------------+
| row1 column1 | row1 column2 |
| row2 column1 | row2 column2 |
| row3 column1 | row3 column2 |
+--------------+--------------+
Source code for examples: example1.py, example2.py, and example3.py
This project adheres to Semantic Versioning.
- Added
git --porcelain
-like table by liiight: Robpol86#31
- Added
- Support for https://pypi.python.org/pypi/colorama
- Support for https://pypi.python.org/pypi/termcolor
- Support for RTL characters (Arabic and Hebrew).
- Support for non-string items in
table_data
like integers.
- Changed
- Refactored again, but this time entire project including tests.
- Removed
padded_table_data
property andjoin_row()
. Moving away from repeated string joining/splitting.
- Fixed
set_terminal_title()
Unicode handling on Windows.- Robpol86#18
- Robpol86#20
- Robpol86#23
- Robpol86#26
- Added
- GitHub Flavored Markdown table by bcho: Robpol86#12
- Python 3.5 support (Linux/OS X and Windows).
- Changed
- Refactored code. No new features.
- Breaking changes:
UnixTable
/WindowsTable
/WindowsTableDouble
moved. UseSingleTable
/DoubleTable
instead.
- Fixed
- CJK character width fixed by zqqf16 and bcho: Robpol86#9
- Added
- Bottom row separator.
- Fixed
- Python 2.7 64-bit terminal width bug on Windows.
- Added
- Windows support.
- Double-lined table.
- Added
table_width
andok
properties.
- Added
- Terminal width/height defaults for testing.
terminaltables.DEFAULT_TERMINAL_WIDTH
terminaltables.DEFAULT_TERMINAL_HEIGHT
- Initial release.