Rich & Textual

Why do I need it?

These two co-related modules will make your command line tools better. “Rich is a Python library for rich text and beautiful formatting in the terminal”, “Textual is a TUI (Text User Interface) framework for Python inspired by modern web development.” which uses Rich for printing. See and

It can also do logging, better REPL printing, trees and much more!


pip install textual


import rich

Why would I use it?

If your making a command line tool this will allow you to create a simple UI (and much easier than using ncurses )

Show me more!

#!/usr/bin/env python

from rich import print
print("We can just replace [bold magenta]print[/bold magenta]!")
print("We can use emoji's",":smiley:")

Simple progress bars

#!/usr/bin/env python
from rich.progress import track

def do_work(s) :
    for i in range(0,10000000) :

for step in track(range(100)):

Make the REPL better

>>> from rich import pretty
>>> pretty.install()

Better inspect

from rich import inspect
import math

Now what?

Have a look at the examples on the github pages and explore.