Calmcode - rich: tables

How to print a pretty table in the terminal with Rich.

1 2 3 4 5 6 7 8 9 10 11 12

Rich Python Tables

Tables are another nice feature that are nice to have in the terminal!

from rich.console import Console
from rich.table import Table

table = Table(title="Pandas Versions")

table.add_column("Released", style="cyan")
table.add_column("Version Number", justify="right", style="magenta")
table.add_column("Description", style="green")

table.add_row("May 29, 2020", "v1.0.4", "Just an update.")
table.add_row("Mar 18, 2020", "v1.0.3", "Just an update.")
table.add_row("Mar 15, 2020", "v1.0.2", "Just an update.")
table.add_row("Feb 05, 2020", "v1.0.1", ":thumbs_up: [underline]Big[/] update.")

console = Console()
console.print(table)