github.com/willmcgugan/rich

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

Open this visualization on its own page →

Contributors

63

Lines of Code

3,598

From

2019-11-10

To

2020-12-21

About willmcgugan/rich

Rich is a Python library that makes it easy to add color, styling, and sophisticated formatting to terminal output. It provides a simple API for adding colors and styles while also offering out-of-the-box support for rendering tables, progress bars, markdown, syntax-highlighted code, tracebacks, emoji, and more. The library works across Linux, macOS, and Windows, with full support for modern terminals and emoji, and also works seamlessly with Jupyter notebooks.

The library is built around a Console object that gives developers fine-grained control over terminal output. Users can style text using markup similar to BBCode syntax, and Rich automatically handles word-wrapping to fit terminal width. Beyond basic printing, Rich includes specialized components like progress bars that can track long-running tasks, spinner animations for indeterminate operations, tree structures for displaying hierarchical data, flexible columns for organized layouts, and beautiful exception tracebacks that are easier to read than standard Python errors.

Rich has become widely adopted in the Python ecosystem for building command-line applications and debugging tools. The project is actively maintained, thoroughly documented, and has been translated into numerous languages. It integrates with Python's built-in logging module and the REPL, making it accessible for developers ranging from those wanting simple colored output to those building complex terminal user interfaces.

Share this video