freshcrate
Home > Frameworks > rich

rich

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

Description

[![Supported Python Versions](https://img.shields.io/pypi/pyversions/rich)](https://pypi.org/project/rich/) [![PyPI version](https://badge.fury.io/py/rich.svg)](https://badge.fury.io/py/rich) [![Downloads](https://pepy.tech/badge/rich/month)](https://pepy.tech/project/rich) [![codecov](https://img.shields.io/codecov/c/github/Textualize/rich?label=codecov&logo=codecov)](https://codecov.io/gh/Textualize/rich) [![Rich blog](https://img.shields.io/badge/blog-rich%20news-yellowgreen)](https://www.willmcgugan.com/tag/rich/) [![Twitter Follow](https://img.shields.io/twitter/follow/willmcgugan.svg?style=social)](https://twitter.com/willmcgugan) ![Logo](https://github.com/textualize/rich/raw/master/imgs/logo.svg) [English readme](https://github.com/textualize/rich/blob/master/README.md) • [简体中文 readme](https://github.com/textualize/rich/blob/master/README.cn.md) • [正體中文 readme](https://github.com/textualize/rich/blob/master/README.zh-tw.md) • [Lengua española readme](https://github.com/textualize/rich/blob/master/README.es.md) • [Deutsche readme](https://github.com/textualize/rich/blob/master/README.de.md) • [Läs på svenska](https://github.com/textualize/rich/blob/master/README.sv.md) • [日本語 readme](https://github.com/textualize/rich/blob/master/README.ja.md) • [한국어 readme](https://github.com/textualize/rich/blob/master/README.kr.md) • [Français readme](https://github.com/textualize/rich/blob/master/README.fr.md) • [Schwizerdütsch readme](https://github.com/textualize/rich/blob/master/README.de-ch.md) • [हिन्दी readme](https://github.com/textualize/rich/blob/master/README.hi.md) • [Português brasileiro readme](https://github.com/textualize/rich/blob/master/README.pt-br.md) • [Italian readme](https://github.com/textualize/rich/blob/master/README.it.md) • [Русский readme](https://github.com/textualize/rich/blob/master/README.ru.md) • [Indonesian readme](https://github.com/textualize/rich/blob/master/README.id.md) • [فارسی readme](https://github.com/textualize/rich/blob/master/README.fa.md) • [Türkçe readme](https://github.com/textualize/rich/blob/master/README.tr.md) • [Polskie readme](https://github.com/textualize/rich/blob/master/README.pl.md) Rich is a Python library for _rich_ text and beautiful formatting in the terminal. The [Rich API](https://rich.readthedocs.io/en/latest/) 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](https://github.com/textualize/rich/raw/master/imgs/features.png) For a video introduction to Rich see [calmcode.io](https://calmcode.io/rich/introduction.html) by [@fishnets88](https://twitter.com/fishnets88). See what [people are saying about Rich](https://www.willmcgugan.com/blog/pages/post/rich-tweets/). ## 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](https://jupyter.org/) 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](https://rich.readthedocs.io/en/latest/introduction.html#quick-start) 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](https://github.com/textualize/rich/raw/master/imgs/print.png) ## 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](https://github.com/textualize/rich/raw/master/imgs/repl.png) ## Using the Console For more control over rich terminal content, import and construct a [Console](https://rich.readthedocs.io/en/latest/reference/console.html#rich.console.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](https://github.com/textualize/rich

Release History

VersionChangesUrgencyDate
15.0.0Imported from PyPI (15.0.0)Low4/21/2026
v15.0.0A 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 - FMedium4/12/2026
v14.3.4No new features in this release, but there should be improved startup time for Rich apps, and potentially improved runtime if you have a lot of links. ## [14.3.4] - 2026-04-11 ### Changed - Improved import time with lazy loading https://github.com/Textualize/rich/pull/4070 - Changed link id generation to avoid random number generation at runtime https://github.com/Textualize/rich/pull/3845Medium4/11/2026
v14.3.3Fixed a infinite loop in split_graphemes ## [14.3.3] - 2026-02-19 ### Fixed - Fixed infinite loop with `cells.split_graphemes` https://github.com/Textualize/rich/pull/4006 Low2/19/2026
v14.3.2A fix for `cell_len` edge cases ## [14.3.2] - 2026-02-01 ### Fixed - Fixed solo ZWJ crash https://github.com/Textualize/rich/pull/3953 - Fixed control codes reporting width of 1 https://github.com/Textualize/rich/pull/3953 Low2/1/2026
v14.3.1Fixed issue with characters outside of unicode range reporting 0 cell size ## [14.3.1] - 2026-01-24 ### Fixed - Fixed characters out of unicode range reporting a cell size if 0 https://github.com/Textualize/rich/pull/3944 Low1/24/2026
v14.3.0Rich now has support for multi-codepoint emojis. There have also been some Markdown improvements, and a number of fixes. See the release notes below for details. ## [14.3.0] - 2026-01-24 ### Fixed - IPython now respects when a `Console` instance is passed to `pretty.install` https://github.com/Textualize/rich/pull/3915 - Fixed extraneous blank line on non-interactive disabled `Progress` https://github.com/Textualize/rich/pull/3905 - Fixed extra padding on first cell in columns https:/Low1/24/2026
v14.2.0This release bumps Python compatibility to the just-released Python 3.14. ## [14.2.0] - 2025-10-09 ### Changed - Python3.14 compatibility https://github.com/Textualize/rich/pull/3861 Low10/9/2025
v14.1.0Live objects may now be nested. Previously a progress bar inside another progress context would fail. See the changelog below for this and other changes. ## [14.1.0] - 2025-06-25 ### Changed - Removed `typing_extensions` from runtime dependencies https://github.com/Textualize/rich/pull/3763 - Live objects (including Progress) may now be nested https://github.com/Textualize/rich/pull/3768 - Added padding property to Syntax which returns a tuple of four integers https://github.com/TextuLow7/25/2025
v14.0.0Mostly updates to Traceback rendering, to add support for features introduced in Python3.11 We also have a new env var that I am proposing to become a standard. `TTY_COMPATIBLE=1` tells Rich to write ansi-escape sequences even if it detects it is not writing to a terminal. This is intended for use with GitHub Actions / CI, which can interpret escape sequences, but aren't a terminal. There is also a change to how NO_COLOR and FORCE_COLOR are interpreted, which is the reason for the major veLow3/30/2025
v13.9.4## [13.9.4] - 2024-11-01 ### Changed - Optimizations to cell_len which may speed up Rich / Textual output https://github.com/Textualize/rich/pull/3546 Low11/2/2024
v13.9.3Fix a broken regex that resulted in the slow path being chosen for some operations. This fix should result in notable speedups for some operations, such as wrapping text. ## [13.9.3] - 2024-10-22 ### Fixed - Fixed broken regex that may have resulted in poor performance. https://github.com/Textualize/rich/pull/3535 Low10/22/2024
v13.9.2A hotfix for highlighting in the table, and a fix for `Segment.split_cells` ## [13.9.2] - 2024-10-04 ### Fixed - Fixed `Table` columns not highlighting when added by `add_row` https://github.com/Textualize/rich/issues/3517 - Fixed an issue with Segment.split_cells reported in Textual https://github.com/Textualize/textual/issues/5090 Low10/4/2024
v13.9.1## [13.9.1] - 2024-10-01 ### Fixed - Fixed typing_extensions dependency Low10/1/2024
v13.9.0This version adds support for fine-grained information in tracebacks. In other words, it will highlight columns in tracebacks (for supported Python versions). Here's an example: <img width="1143" alt="Screenshot 2024-10-01 at 13 07 35" src="https://github.com/user-attachments/assets/d1405f90-4ae5-4fad-83ce-05c2e4542f4e"> This version also **drops support for Python 3.7**, which has long since reached its EOL. If you are stuck on Python3.7 for any reason, you will not be able to upgrade to Low10/1/2024
v13.8.1## [13.8.1] - 2024-09-10 ### Fixed - Added support for Python 3.13 https://github.com/Textualize/rich/pull/3481 - Fixed infinite loop when appending Text to same instance https://github.com/Textualize/rich/pull/3480 Low9/10/2024
v13.8.0This is a fairly large update. Mostly an accumulation of small fixes and enhancements. Nothing qualifies as a *breaking change (for some definition), but there may be some subtly changes to output. Check below for anything that might affect you! ## [13.8.0] - 2024-08-26 ### Fixed - Fixed `Table` rendering of box elements so "footer" elements truly appear at bottom of table, "mid" elements in main table body. - Fixed styles in Panel when Text objects are used for title https://github.coLow8/26/2024
v13.7.1Fixes some character widths ## [13.7.1] - 2023-02-28 ### Fixed - Updated the widths of some characters https://github.com/Textualize/rich/pull/3289 Low2/28/2024
v13.7.0## [13.7.0] - 2023-11-15 ### Added - Adds missing parameters to Panel.fit https://github.com/Textualize/rich/issues/3142 ### Fixed - Some text goes missing during wrapping when it contains double width characters https://github.com/Textualize/rich/issues/3176 - Ensure font is correctly inherited in exported HTML https://github.com/Textualize/rich/issues/3104 - Fixed typing for `FloatPrompt`. Low11/15/2023
v13.6.0Mostly a meta update in readiness for the release of Python3.12 ## [13.6.0] - 2023-09-30 ### Added - Added Python 3.12 to classifiers. Low9/30/2023
v13.5.3## [13.5.3] - 2023-09-17 ### Fixed - Markdown table rendering issue with inline styles and links https://github.com/Textualize/rich/issues/3115 - Fix Markdown code blocks on a light background https://github.com/Textualize/rich/issues/3123 Low9/17/2023
v13.5.2Bugfix ## [13.5.2] - 2023-08-01 ### Fixed - Fixed Text.expand_tabs assertion errorLow8/1/2023
v13.5.1Very minor update to URL highlighting ## [13.5.1] - 2023-07-31 ### Fixed - Fix tilde character (`~`) not included in link regex when printing to console https://github.com/Textualize/rich/issues/3057 Low7/31/2023
v13.5.0https://textual.textualize.io/blog/2023/07/29/pull-requests-are-cake-or-puppies/ ## [13.5.0] - 2023-07-29 ### Fixed - Fixed Text.expand_tabs not expanding spans. - Fixed TimeElapsedColumn from showing negative. - Fix for escaping strings with a trailing backslash https://github.com/Textualize/rich/issues/2987 - Fixed exception in Markdown with partial table https://github.com/Textualize/rich/issues/3053 - Fixed the HTML export template so that the `<html>` tag comes before the `<heLow7/29/2023
v13.4.2## [13.4.2] - 2023-06-12 ### Changed - Relaxed markdown-it-py dependencyLow6/12/2023
v13.4.1## [13.4.1] - 2023-05-31 ### Fixed - Fixed typing extensions import in markdown https://github.com/Textualize/rich/issues/2979 Low5/31/2023
v13.4.0## [13.4.0] - 2023-05-31 ### Added - Added support for tables in `Markdown` https://github.com/Textualize/rich/pull/2977 ![table](https://github.com/Textualize/rich/assets/554369/4adfce16-4095-44ad-99b2-52e74ba1813a) Low5/31/2023
v13.3.5## [13.3.5] - 2023-04-27 ### Fixed - Fixed italic indent guides in SVG output Low4/27/2023
v13.3.4## [13.3.4] - 2023-04-12 ### Fixed - Fixed for `is_terminal` ignoring FORCE_COLOR https://github.com/Textualize/rich/pull/2923 Low4/12/2023
v13.3.3Just a new method on the Style class. A helper for Textual, you probable aren't going to need it. ## [13.3.3] - 2023-02-27 ### Added - Added Style.clear_meta_and_links Low3/27/2023
v13.3.2Mixed bag, mostly fixes ## [13.3.2] - 2023-02-04 ### Fixed - Reversed `pre` and `code` tags in base HTML format https://github.com/Textualize/rich/pull/2642 - Fix syntax error when building with nuitka https://github.com/Textualize/rich/pull/2635 - Fixed pretty printing of empty dataclass https://github.com/Textualize/rich/issues/2819 - Use `Console(stderr=True)` in `rich.traceback.install` to support io redirection. - Fixes superfluous spaces in html output https://github.com/TextuLow3/4/2023
v13.3.1This release contains a fix for truecolor to eight bit color conversion, which results in more accurate colors. ## [13.3.1] - 2023-01-28 ### Fixed - Fixed truecolor to eight bit color conversion https://github.com/Textualize/rich/pull/2785 Low1/28/2023
v13.3.0## [13.3.0] - 2023-01-27 ### Fixed - Fixed failing tests due to Pygments dependency https://github.com/Textualize/rich/issues/2757 - Relaxed ipywidgets https://github.com/Textualize/rich/issues/2767 ### Added - Added `encoding` parameter in `Theme.read` Low1/27/2023
v13.2.0v13.2.0 replaces the unmaintained `commonmark` library with `markdown-it-py`. This new parser has a lot more capabilities and will allow us to implement a number of additional Markdown features in the future. The output from the `Markdown` renderable may change a little from previous versions. ## [13.2.0] - 2023-01-19 ### Changed - Switch Markdown parsing from commonmark to markdown-it-py https://github.com/Textualize/rich/pull/2439 Low1/19/2023
v13.1.0This release fixes tracebacks in Jupyter which didn't show the code. Additionally tracebacks have two new parameters to hide double underscore and single underscore locals. See the changelog for details <img width="947" alt="Screenshot 2023-01-14 at 11 26 38" src="https://user-images.githubusercontent.com/554369/212469643-a6f80ccf-93cd-4970-90fd-eb0f384b4e28.png"> ## [13.1.0] - 2023-01-14 ### Fixed - Fixed wrong filenames in Jupyter tracebacks https://github.com/Textualize/rich/Low1/14/2023
v13.0.1Fix for an issue where Segment.split_cells produced the wrong result. Mostly a hotfix for the benefit of Textual. ## [13.0.1] - 2023-01-06 ### Fixed - Fixed issue with Segment.split_cells for mixed single and double cell widths Low1/6/2023
v13.0.0Some relatively minor fixes and improvements. The most significant update (and the reason for the major version bump) is that Rich has dropped Python3.6 support. If you are a Python3.6 user and can't upgrade for whatever reason, pin to version 12.6.0. ## [13.0.0] - 2022-12-30 ### Fixed - Reversed `pre` and `code` tags in base HTML format https://github.com/Textualize/rich/pull/2642 - Improved detection of `attrs` library, that isn't confused by the presence of the `attr` library. -Low12/30/2022
v12.6.0 **NOTE:** 12.6.0 may be the last version to support Python3.6. The next version will be 13.0.0, and will be Python3.7+ ## [12.6.0] - 2022-10-02 ### Added - Parse ANSI escape sequences in pretty repr https://github.com/Textualize/rich/pull/2470 - Add support for `FORCE_COLOR` env var https://github.com/Textualize/rich/pull/2449 - Allow a `max_depth` argument to be passed to the `install()` hook https://github.com/Textualize/rich/issues/2486 - Document using `None` as name in `__richLow10/2/2022
v12.5.1## [12.5.1] - 2022-07-11 ### Fixed - Fixed missing typing extensions dependency on 3.9 https://github.com/Textualize/rich/issues/2386Low7/11/2022
v12.5.0 ## [12.5.0] - 2022-07-11 ### Added - Environment variables `JUPYTER_COLUMNS` and `JUPYTER_LINES` to control width and height of console in Jupyter - Markdown friendly `Box` style, `MARKDOWN`, for rendering tables ready to copy into markdown files - `inspect` will prefix coroutine functions with `async def` ### Changed - Default width of Jupyter console size is increased to 115 - Optimized Segment.divide - `Style.__add__` will no longer return `NotImplemented` - Remove rich.\_lLow7/11/2022
v12.4.4## [12.4.4] - 2022-05-24 ### Changed - Added clipping per line to SVG output to avoid box characters overlapping - Optimized SVG outputLow5/24/2022
v12.4.3## [12.4.3] - 2022-05-23 ### Changed - Further tweaks to SVG character matrix - Added clip rect to SVG to prevent box characters overlapping bottom of terminal Low5/23/2022
v12.4.2## [12.4.2] - 2022-05-23 ### Fixed - Fix for SVG on Firefox ### Changed - Removed excess margin from SVG, tweaked cell sizes to better render block characters Low5/23/2022
v12.4.1A fix and further enhancements to the SVG export. Default color scheme is now dimmed Monokai, and there is a keyline around the terminal so it looks distinct against a dark background. ![Rich SVG example](https://user-images.githubusercontent.com/554369/167307024-2f354792-9ba2-4dea-bf60-dba34ae584ce.svg) ## [12.4.1] - 2022-05-08 ### Fixed - Fix for default background color in SVG export https://github.com/Textualize/rich/issues/2260 ### Changed - Added a keyline around SVGLow5/8/2022
v12.4.0This release has a major change to the SVG export. It is now a simpler design, and will render outside of a browser. ![deniro](https://user-images.githubusercontent.com/554369/167259746-9b236fe3-95a6-4b47-bac8-ee7626fecff0.svg) <img width="1387" alt="Screenshot 2022-05-07 at 15 57 54" src="https://user-images.githubusercontent.com/554369/167259817-4ecd292a-6ce0-4a3e-a3b5-65bd00837e4e.png"> ## [12.4.0] - 2022-05-07 ### Changed - Rebuilt SVG export to create a simpler SVG that is Low5/7/2022
v12.3.0 ## [12.3.0] - 2022-04-26 ### Added - Ability to change terminal window title https://github.com/Textualize/rich/pull/2200 - Added show_speed parameter to progress.track which will show the speed when the total is not known - Python blocks can now opt out from being rendered in tracebacks's frames, by setting a `_rich_traceback_omit = True` in their local scope https://github.com/Textualize/rich/issues/2207 ### Fixed - Fall back to `sys.__stderr__` on POSIX systems when trying to Low4/26/2022
v12.2.0## [12.2.0] - 2022-05-05 ### Changed - Bumped typing-extensions minimum to 4.0.0 - Bumped minimum Python version to 3.6.3Low4/5/2022
v12.1.0 ![Snap export svg](https://user-images.githubusercontent.com/554369/161432136-ff358814-115e-4c79-995c-8e599ce2ded3.png) ![Snap](https://user-images.githubusercontent.com/554369/161432140-a0bbe3b2-4f4c-4092-ac9d-950057cc546e.png) ## [12.1.0] - 2022-04-03 ### Added - Progress.open and Progress.wrap_file method to track the progress while reading from a file or file-like object https://github.com/willmcgugan/rich/pull/1759 - SVG export functionality https://github.com/Textualize/richLow4/3/2022
v12.0.1## [12.0.1] - 2022-03-22 ### Changed - Improve performance of cell_length https://github.com/Textualize/rich/pull/2061 - Improve performance of chop_cells https://github.com/Textualize/rich/pull/2077 ### Fixed - Fix capturing stdout on legacy Windows https://github.com/Textualize/rich/pull/2066 Low3/22/2022
v12.0.0This release drops Colorama as a dependancy in favour of an internal Win32 render. There are some new features for progress bars, added support for pretty printing named tuples, and a bunch of fixes. As a major version there are a few breaking changes, see below. ## [12.0.0] - 2022-03-10 ### Added - Added options to TimeRemainingColumn to render a compact time format and render elapsed time when a task is finished. https://github.com/Textualize/rich/pull/1992 - Added ProgressCLow3/10/2022
v11.2.0## [11.2.0] - 2022-02-08 ### Added - Add support for US spelling of "gray" in ANSI color names https://github.com/Textualize/rich/issues/1890 - Added `rich.diagnose.report` to expose environment debugging logic as function https://github.com/Textualize/rich/pull/1917 - Added classmethod `Progress.get_default_columns()` to get the default list of progress bar columns https://github.com/Textualize/rich/pull/1894 ### Fixed - Fixed performance issue in measuring textLow2/8/2022

Dependencies & License Audit

Loading dependencies...

Similar Packages

pre-commitA framework for managing and maintaining multi-language pre-commit hooks.v4.6.0
azure-core-tracing-opentelemetryMicrosoft Azure Azure Core OpenTelemetry plugin Library for Pythonazure-template_0.1.0b6187637
spdx-toolsSPDX parser and tools.0.8.5
lacesDjango components that know how to render themselves.0.1.2
django-tasksA backport of Django's built in Tasks framework0.12.0