Generate simple tables in terminals from a nested list of strings.
Project Links
Meta
Author: Robpol86
Requires Python: >=2.6
Classifiers
Development Status
- 5 - Production/Stable
Environment
- Console
- MacOS X
- Win32 (MS Windows)
Intended Audience
- Developers
License
- OSI Approved :: MIT License
Operating System
- MacOS :: MacOS X
- Microsoft :: Windows
- POSIX
- POSIX :: Linux
Programming Language
- Python :: 2
- Python :: 2.6
- Python :: 2.7
- Python :: 3
- Python :: 3.10
- Python :: 3.3
- Python :: 3.4
- Python :: 3.5
- Python :: 3.6
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
- Python :: Implementation :: PyPy
Topic
- Software Development :: Libraries
- Terminals
- Text Processing :: Markup
terminaltables
What is it
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
Quickstart
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 |
+--------------+--------------+
Example Implementations

Source code for examples:
3.1.10
Dec 07, 2021
3.1.9
Dec 07, 2021
3.1.8
Dec 07, 2021
3.1.7
Dec 07, 2021
3.1.6
Dec 07, 2021
3.1.5
Dec 07, 2021
3.1.0
Oct 17, 2016
3.0.0
May 31, 2016
2.1.0
Nov 03, 2015
2.0.0
Oct 12, 2015
1.2.1
Sep 04, 2015
1.2.0
Jun 01, 2015
1.1.1
Nov 04, 2014
1.1.0
Nov 03, 2014
1.0.2
Sep 19, 2014
1.0.1
Sep 13, 2014
1.0.0
Sep 12, 2014
Wheel compatibility matrix
Files in release
No dependencies