Tabulate
Tabulate is a handy Python package on PyPI you can install to make fancy terminal tables.
Install
With pipenv
With pip and virtualenv
Example
Take a list of lists, and use tabulate to create pretty terminal tables. I created a simple file called tabulate_example.py in a dedicated venv.
from tabulate import tabulate
example_list = [["Beverly Hills","California", "United States"],["Minneapolis", "Minnesota", "United States"],["Chicago","Illinois","United States"]]
print(tabulate(example_list, headers=["City","State","Country"], tablefmt="pretty"))
Windows
Output
Use Case
I recently found myself having to interact with AWS APIs and was manipulating the data structures in response and wanted to display a fairly large amount of items in my terminal.