Pythonrichv14.3.3
PythonBeginner-friendly

rich

Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal

cliterminalcolorsprogress-bartables
The Problem

Terminal output in Python is stuck in the 1970s by default โ€” monochrome text, manual string formatting for tables, and no way to show progress without writing your own ANSI escape sequences. Rich changed the expectation of what a well-crafted CLI tool should look like.

Mental Model

Rich is a markup-over-print-statements system. Use rich.print() instead of print() and add [bold red]text[/bold red] markup in your strings. For structured output, create Table or Panel objects and pass them to a Console. Under the hood, Rich auto-detects whether the terminal supports colour and gracefully degrades.

60-second start

Install rich

pip install rich
import rich

Use it when

Use Rich in any CLI tool or long-running script where you want readable output: progress bars for downloads or processing loops, syntax-highlighted code, formatted tables, structured log output, or pretty-printed Python objects for debugging.

Skip it when

Rich adds 1-2MB to your package size and a startup cost. For library code that should be output-agnostic, stick to logging. For applications deployed purely as web services with no terminal interaction, Rich adds nothing.

Alternatives
coloramaLighter weight cross-platform colour support; less feature-rich but smaller footprint
tqdmFocused purely on progress bars โ€” simpler to use for that single use case
textualFull TUI framework built on Rich โ€” use it when you need interactive terminal apps, not just output

Ready to explore the full API?

See every class, function, and relationship in an interactive graph.