Textualize /rich

Rich is a Python library for rich text and beautiful formatting in the terminal.

★ 57,812⑂ 2,506👁 522⑃ 1,504● 1,565▤ 177
PythonMITCreated 2019-11-10rich.readthedocs.io/en/latest/
TA的项目
下载:The So Long 3.8 ReleaseThe-15.0.0 ↓15.0.02026-04-12
+10
日增长
+48
周增长
57,812
stars
2,506
forks
522
watchers
1,504
prs
1,565
issues
177
releases

README

!Logo

English readme
 • 简体中文 readme
 • 正體中文 readme
 • Lengua española readme
 • Deutsche readme
 • Läs på svenska
 • 日本語 readme
 • 한국어 readme
 • Français readme
 • Schwizerdütsch readme
 • हिन्दी readme
 • Português brasileiro readme
 • Italian readme
 • Русский readme
 • Indonesian readme
 • فارسی readme
 • Türkçe readme
 • Polskie readme


Rich is a Python library for _rich_ text and beautiful formatting in the terminal.

The Rich API makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more — out of the box.

!Features

For a video introduction to Rich see calmcode.io by @fishnets88.

See what people are saying about Rich.

 Compatibility

Rich works with Linux, macOS and Windows. True color / emoji works with new Windows Terminal, classic terminal is limited to 16 colors. Rich requires Python 3.8 or later.

Rich works with Jupyter notebooks with no additional configuration required.

 Installing

Install with pip or your favorite PyPI package manager.

sh
python -m pip install rich


Run the following to test Rich output on your terminal:

sh
python -m rich


 Rich Print

To effortlessly add rich output to your application, you can import the rich print method, which has the same signature as the builtin Python function. Try this:

python
from rich import print

print("Hello, [bold magenta]World[/bold magenta]!", ":vampire:", locals())


!Hello World

 Rich REPL

Rich can be installed in the Python REPL, so that any data structures will be pretty printed and highlighted.

python
 from rich import pretty
 pretty.install()


!REPL

 Using the Console

For more control over rich terminal content, import and construct a Console object.

python
from rich.console import Console

console = Console()


The Console object has a print method which has an intentionally similar interface to the builtin print function. Here's an example of use:

python
console.print("Hello", "World!")


As you might expect, this will print "Hello World!" to the terminal. Note that unlike the builtin print function, Rich will word-wrap your text to fit within the terminal width.

There are a few ways of adding color and style to your output. You can set a style for the entire output by adding a style keyword argument. Here's an example:

python
console.print("Hello", "World!", style="bold red")


The output will be something like the following:

!Hello World

That's fine for styling a line of text at a time. For more finely grained styling, Rich renders a special markup which is similar in syntax to bbcode. Here's an example:

python
console.print("Where there is a [bold cyan]Will[/bold cyan] there [u]is[/u] a [i]way[/i].")


!Console Markup

You can use a Console object to generate sophisticated output with minimal effort. See the Console API docs for details.

 Rich Inspect

Rich has an inspect function which can produce a report on any Python object, such as

Top issues

Discussions

Latest release

The So Long 3.8 Release v15.0.0 2026-04-12
A few fixes. The major version bump is to honor the passing of 3.8 support which reached its EOL in October 7, 2024

 [15.0.0] - 2026-04-12

 Changed

- Breaking change: Dropped support for Python3.8

 Fixed

- Fixed empty print ignoring the end parameter https://github.com/Textualize/rich/pull/4075
- Fixed Text.from_ansi removing newlines https://github.com/Textualize/rich/pull/4076
- Fixed FileProxy.isatty not proxying https://github.com/Textualize/rich/pull/4077
- Fixed inline code in Markdown tables cells https://github.com/Textualize/rich/pull/4079

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON