HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
Textualize
rich
Python2020–2024
Textualize / rich

rich

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

41Distinct people
46Mentions
3Explicit recommenders
57.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

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

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

They keep getting improved error messaging and this is one of my favorite features. But I'd love if we could get some real rich text. Idk if anyone else uses rich, but it has…

godelski used a recommendation phrase. 3 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 9:28:18 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year46 dated mentions

Observed mentions: 2020-04-08 15:32:59 UTC to 2024-08-12 01:22:41 UTC.

0510152020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 9 mentions; 5 submissions, 4 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 16 mentions; 0 submissions, 16 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC954
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC16016
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC716
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC716
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC716

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
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. 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. python -m pip install rich Run the following to test Rich output on your terminal: 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: from rich import print print("Hello, [bold magenta]World[/bold magenta]!", ":vampire:", locals()) Rich REPL Rich can be installed in the Python REPL, so that any data structures will be pretty printed and highlighted. >>> from rich import pretty >>> pretty.install() Using the Console For more control over rich terminal content, import and construct a Console object. 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: 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: console.print("Hello", "World!", style="bold red") The output will be something like the following: 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: console.print("Where there is a [bold cyan]Will[/bold cyan] there [u]is[/u] a [i]way[/i].") 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 class, instance, or builtin. >>> my_list = ["foo", "bar"] >>> from rich import inspect >>> inspect(my_list, methods=True) See the inspect docs for details. Rich Library Rich contains a number of builtin renderables you can use to create elegant output in your CLI and help you debug your code. Click the following headings for details: Log The Console object has a log() method which has a similar interface to print(), but also renders a column for the current time and the file and line which made the call. By default Rich will do syntax highlighting for Python structures and for repr strings. If you log a collection (i.e. a dict or a list) Rich will pretty print it so that it fits in the available space. Here's an example of some of these features. from rich.console import Console console = Console() test_data = [ {"jsonrpc": "2.0", "method": "sum", "params": [None, 1, 2, 4, False, True], "id": "1",}, {"jsonrpc": "2.0", "method": "notify_hello", "params": [7]}, {"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": "2"}, ] def test_log(): enabled = False context = { "foo": "bar", } movies = ["Deadpool", "Rise of the Skywalker"] console.log("Hello from", console, "!") console.log(test_data, log_locals=True) test_log() The above produces the following output: Note the log_locals argument, which outputs a table containing the local variables where the log method was called. The log method could be used for logging to the terminal for long running applications such as servers, but is also a very nice debugging aid. Logging Handler You can also use the builtin Handler class to format and colorize output from Python's logging module. Here's an example of the output: Emoji To insert an emoji in to console output place the name between two colons. Here's an example: >>> console.print(":smiley: :vampire: :pile_of_poo: :thumbs_up: :raccoon:") 😃 🧛 💩 👍 🦝 Please use this feature wisely. Tables Rich can render flexible tables with unicode box characters. There is a large variety of formatting options for borders, styles, cell alignment etc. The animation above was generated with table_movie.py in the examples directory. Here's a simpler table example: from rich.console import Console from rich.table import Table console = Console() table = Table(show_header=True, header_style="bold magenta") table.add_column("Date", style="dim", width=12) table.add_column("Title") table.add_column("Production Budget", justify="right") table.add_column("Box Office", justify="right") table.add_row( "Dec 20, 2019", "Star Wars: The Rise of Skywalker", "$275,000,000", "$375,126,118" ) table.add_row( "May 25, 2018", "[red]Solo[/red]: A Star Wars Story", "$275,000,000", "$393,151,347", ) table.add_row( "Dec 15, 2017", "Star Wars Ep. VIII: The Last Jedi", "$262,000,000", "[bold]$1,332,539,889[/bold]", ) console.print(table) This produces the following output: Note that console markup is rendered in the same way as print() and log(). In fact, anything that is renderable by Rich may be included in the headers / rows (even other tables). The Table c
Read the full README on GitHub

What Hacker News says

16 sources
I had to look these up (just me doing Google searches): - tqdm: progress bars (https://tqdm.github.io/) - rich: text formatting (https://github.com/willmcgugan/rich) - textual: TUI, using rich (https://github.com/willmcgugan/textual) - fastpi: Rest APIs (https://fastapi.tiangolo.com/) - typer: CLI Library, uses Click (https://typer.tiangolo.com/) - pydantic: Custom data types (https://pydantic-docs.helpmanual.io/) - shiv: Create Python zipapps (https://shiv.readthedocs.io/en/latest/) - toga: GUI Toolkit (https://toga.readthedocs.io/en/latest/) - doit: Task runner (https://pydoit.org/) - diskcache: A disk cache (https://github.com/grantjenks/python-diskcache/)
In Tqdm (Python)
https://github.com/willmcgugan/rich > 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. Seems Rich is not just displaying pretty text, it seems to almost be a full blown UI library that can render components and more. Since the API surface is that big, it's possible for bugs to slip through, and those have to be fixed by someone. Then once companies and other people start depending on this library, they start being dependent on fixes to also be made to it as new platforms appear, new terminals get written and so on. Either the companies/people can start contributing their fixes directly upstream, or the can
Read the rest
fund one person who can do it for them, and for other users of the library. Although most of us know what happens in situations like this: no one except the original author actually fixes stuff, until the author looses interests and moves on.
In I'm working on open source full time
I love TUIs. They are clear, quick and easy to use. Probably because they require straightforward design. I just read the following links to build up foundation of knowledge first - low-level: http://%CA%9E.cc/irl/term.html https://viewsourcecode.org/snaptoken/kilo/02.enteringRawMode... https://en.wikipedia.org/wiki/ANSI_escape_code#Colors Other libraries: # C, C++, Python and Rust https://github.com/dankamongmen/notcurses # Python, more polished presentation - but I cannot judge the technical foundation https://github.com/willmcgugan/rich
In Writing Programs with Ncurses
Mainly it's the absurd amount of functionality that's packed into the library, in a way that interoperates in a predictable way. Rich does a LOT of stuff, and all of the things it does work with each other - so it's easy to compose them together into sophisticated combined layouts. It can render Markdown in a way that works on a console. It has gorgeous progress bars and spinners built in. It has a very competent table layout mechanism. https://github.com/willmcgugan/rich/tree/master/examples is full of neat examples of what it can do - all very Pythonic in the way they work.
In Textual: a Python text user interface with Rich as the renderer
TUIs are wonderful. They are easy to grasp, fast and restrict requirements, everyone involved must think about the workflow and efficient usage. Input is focused entirely on the keyboard. Linux overs some modern TUIs e.g. installer, apt-stuff or the kernel config aside from that: https://invisible-island.net/ncurses/ // classic https://github.com/willmcgugan/rich // blingbling https://github.com/dankamongmen/notcurses // hacker For the old stuff I recommend looking close at airports, savings-banks or part-dealers. When it is influenced by mainframes you will notice likely forwards/backwards is done by F7/F8. How do you depict an plane with seats in TUI? I assume an array, 80 rows and 10 columns ;) I'm impressed how flawless elderly co-workers work with TUIs. They read the screen, think and type and the work is done. I guess the straight
Read the rest
workflow, clean user-interface and similarities to paper forms improve usability. I guess modal dialogs, popup warnings, status icons, right click and the modern long press are not an improvement in usability. And the many tiny icons and bars in modern text processors aren't a help either. I think we can learn a lot more from old programmers.
In Notepad++ v8 release
Clean and unobtrusive design, with a focus in typography, layout, ample whitespace, and a color palette that provides context and visual information without being gaudy and flashy. With that said, it looks exactly like it could be a random CLI application running in an Oh My Zsh theme. Not much differentiation there. EDIT: I feel like this app could be created in a few hours by wrapping a context-aware unit/currency conversion library with Rich Python [0]. [0]: https://github.com/willmcgugan/rich
In Numi – Calculator app for Mac
I read this entire thread thinking - this is neat and all but it’s a handful of lines of almost english language in a .py file. Click is a neat upgrade from argparse if you’re ever tempted (assuming something like “pip install —-user” is viable in your situation which isn’t true for everyone). I’ve seen, but haven’t used https://typer.tiangolo.com/ - i have used his FastAPI and thought that was nicely done (even if python async is a bit annoying to test). Talking of python cli libs I haven’t tried but will do one day - rich: https://github.com/willmcgugan/rich
In Writing Small CLI Programs in Common Lisp

Showing the 15 most recent of 16 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.