About this project

Rich is a Python library for rich text and beautiful formatting in the terminal. It provides an API that makes it easy to add color and style to terminal output, and it can render pretty tables, progress bars, markdown, syntax-highlighted source code, tracebacks, and more out of the box. Compatibility: Rich works with Linux, macOS, and Windows. True color and emoji work with the new Windows Terminal; the classic terminal is limited to 16 colors. It requires Python 3.8 or later and also works with Jupyter notebooks with no additional configuration. Installation: Install with pip (`python -m pip install rich`) and test output with `python -m rich`. Rich print: Import `rich.print` to get a version with the same signature as the built-in `print`, plus markup support such as `[bold magenta]World[/bold magenta]` and emoji names. Rich can also be installed into the Python REPL via `pretty.install()` so data structures are pretty-printed and highlighted. Console API: The `Console` object offers a `print` method similar to the built-in, with word-wrapping, style keyword arguments, and BBCode-like console markup. It also has a `log` method that adds time and location columns and can pretty-print collections, with a `log_locals` option to show local variables. There is a built-in logging Handler for Python's logging module. Built-in renderables include: - Emoji: insert emoji by name between colons, e.g. `:smiley:`. - Tables: flexible Unicode tables with configurable borders, styles, cell alignment, and columns that resize to fit the terminal. - Progress bars: multiple flicker-free progress bars via `track` or custom column configurations for percentage, file size, speed, and time remaining. - Status: spinner animation and message with the `status` context manager; available spinners can be browsed with `python -m rich.spinner`. - Tree: hierarchical data rendering with guide lines, suitable for file structures; `python -m rich.tree` demonstrates it. - Columns: neat content columns with equal or optimal width, similar to directory listings. - Markdown: render Markdown formatting in the terminal using the `Markdown` class. - Syntax highlighting: powered by Pygments via the `Syntax` object, with themes and line numbers. - Tracebacks: beautiful, easier-to-read tracebacks showing more code than standard Python tracebacks, and configurable as the default handler. Rich renderables are built on the Console Protocol, allowing users to implement their own Rich content. Related projects mentioned in the README include Rich CLI, a command-line application for syntax highlighting, Markdown rendering, and CSV display in tables, and Textual, a sister project for building sophisticated terminal user interfaces.