rich

Utilities

Terminal styling

Try rich in PyRun

What is rich?

Rich is a Python library for writing rich text to the terminal. It supports markdown rendering, syntax highlighting, tables, progress bars, pretty-printed tracebacks, and a wide range of other formatting options — all with a simple, expressive API.

In PyRun's terminal, Rich's styling comes through as formatted output, making it an excellent tool for building well-presented CLI output. Whether you're building a data reporting script or simply want nicer print statements, Rich works out of the box via micropip with no installation required.

Code Example

Styled panels and tables using the Rich library.

Rich Terminal Tables
Try in Editor
from rich.console import Console
from rich.table import Table
from rich.panel import Panel

console = Console()

console.print(Panel.fit("[bold green]Welcome to PyRun[/bold green]", border_style="green"))

table = Table(title="Top Programming Languages")
table.add_column("Rank", justify="center", style="cyan", no_wrap=True)
table.add_column("Language", style="magenta")
table.add_column("Type", style="green")
table.add_column("Popular For", style="yellow")

table.add_row("1", "Python",     "Dynamic", "Data Science, AI")
table.add_row("2", "JavaScript", "Dynamic", "Web, Node")
table.add_row("3", "TypeScript", "Static",  "Large-scale Web")
table.add_row("4", "Rust",       "Static",  "Systems, WASM")

console.print(table)

Why run rich in PyRun?

  • Zero setup — no pip install, no virtual environment, no Python download
  • Instant results — powered by WebAssembly, runs locally in your browser
  • Share your code — generate a link and anyone can run it instantly
  • Works offline — after first load, PyRun runs without internet
Open editor with rich example

Related Packages