rich

A Python library for rendering rich text, tables, progress bars, and syntax-highlighted code in the terminal.

Library
PyPI
v15.0.0
57,489 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
56 /100 Fair
Development Activity 12
Maintenance 48
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
89 /100 Excellent
Architecture 85
Code Quality 88
Innovation 92
Learning Curve 90

Rich turns plain terminal output into readable, well-formatted text with almost no extra code. A single import replaces the built-in print function with one that understands colors, styles, and a compact BBCode-like markup, while a Console object gives finer control over layout, word-wrapping, and terminal width detection.

Beyond text styling, Rich ships a full set of renderables: tables that auto-size to their content, progress bars that track multiple concurrent tasks, live-updating displays that redraw in place, Markdown rendering, and Pygments-backed syntax highlighting for code blocks and tracebacks. Any object can plug into this system by implementing the __rich_console__ protocol, so third-party libraries can render themselves through Rich without Rich needing to know about them in advance.

It also works outside the terminal: pretty.install() upgrades the Python REPL to auto-format data structures, and output can be exported to HTML or SVG for embedding elsewhere, including Jupyter notebooks.

What You Get

  • A Console object and drop-in print() replacement with markup-based colors and styles
  • Renderables for tables, panels, columns, trees, and progress bars that auto-size to terminal width
  • Live-updating displays (Live, Progress) that redraw in place without flicker
  • Pygments-backed syntax highlighting for code blocks and exception tracebacks
  • Markdown rendering and pretty-printing of Python data structures (pretty.install())
  • HTML and SVG export of rendered output for embedding outside the terminal

Common Use Cases

  • Formatting CLI tool output with colors, tables, and progress indicators
  • Rendering readable, syntax-highlighted tracebacks for easier debugging
  • Building live dashboards or progress displays for long-running scripts
  • Pretty-printing complex data structures during interactive REPL sessions
  • Rendering Markdown or code snippets directly in terminal-based tools

Under The Hood

Architecture Rich centers on a Console object (rich/console.py, ~2,700 lines) that orchestrates rendering: any object implementing the renderable protocol (__rich_console__ and __rich_measure__, defined in rich/protocol.py and rich/abc.py) can be handed to console.print() and rendered without Console needing prior knowledge of its type. Renderables (Table, Panel, Markdown, Syntax, Progress, Layout, and others, each its own module) yield a stream of Segment objects — the atomic unit pairing text with a Style — which Console then converts into ANSI control codes via control.py, with a separate ctypes-based path through _win32_console.py/_windows_renderer.py for older Windows terminals. Live and Progress build on this same Console/Segment pipeline to redraw regions in place. This protocol-based, duck-typed design means the core abstraction to change carefully is the renderable protocol itself — nearly every built-in renderable and any third-party integration depends on it.

Tech Stack Rich targets Python 3.9+ and is built/packaged with Poetry (poetry-core backend, pyproject.toml). Its only required runtime dependencies are pygments (>=2.13) for syntax highlighting and markdown-it-py (>=2.2.0) for Markdown rendering, with ipywidgets as an optional extra for Jupyter integration. There is no web or database layer — it’s a pure terminal-rendering library. Development tooling includes pytest for testing, black and isort (black profile) for formatting, mypy in strict mode for type checking, and pre-commit hooks (pycln, codespell, and standard hygiene checks) enforced via GitHub Actions CI (pythonpackage.yml, codeql.yml for security scanning).

Code Quality The repo ships a py.typed marker and enforces mypy in strict mode with additional error codes enabled (ignore-without-code, redundant-expr, truthy-bool), indicating a genuine commitment to type safety rather than a token typed export. Test coverage is extensive: 68 files under tests/, covering individual renderables (tables, panels, columns, bars, colors, control sequences) with a shared conftest.py and dedicated SVG/card rendering test helpers. Formatting and import order are enforced via black and isort through pre-commit, and a custom errors.py module defines a clear exception hierarchy rather than relying on generic exceptions. CI runs the test suite plus CodeQL security scanning on every change.

API Design Rich’s headline design choice is making the common case a near drop-in replacement for the built-in print — from rich import print requires no other setup to get colored, word-wrapped output. Styling is expressed through a compact BBCode-like markup ([bold red]...[/]) rather than manual ANSI escape codes, and more advanced usage flows naturally through a single Console object rather than a scattered API surface. Documentation is thorough (readthedocs reference plus READMEs translated into 17 languages), and the renderable protocol keeps the public API small while still letting advanced users define fully custom renderables. The result is very low boilerplate for basic use and a consistent mental model as usage grows more advanced.

Used by 47 apps in this directory

Python
99%
MIT

Agent Lightning

AI Development

18,631

A Microsoft-built training framework that optimizes AI agents with reinforcement learning, automatic prompt optimization, or supervised fine-tuning — with near-zero code changes to your existing agent, in any framework.

View details
85
Repo Health
68
Technical
70
Dependency
Built with
Python 99%
Updated yesterday
Python
100%
Apache 2.0

Agno

AI Development · Automation · Devops

42,644

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python 100%
Updated today
Python
47%
Other

Airbyte

Data Engineering · Developer Tools

22,200

Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.

View details
95
Repo Health
80
Technical
64
Dependency
Built with
Python 47%
Kotlin 45%
Updated today
Python
88%
Apache 2.0

Apache Airflow

Data Engineering

47,133

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
64
Dependency
Built with
Python 88%
Updated today
Python
68%
MIT

ArchiveBox

Bookmarks Archiving

28,723

Self-hosted web archiving that saves HTML, PDFs, screenshots, media, and code in open formats you own forever

View details
88
Repo Health
84
Technical
69
Dependency
Built with
Python 68%
HTML 25%
Updated yesterday
Python
59%
Apache 2.0

argilla

AI Development · Data Engineering

5,143

Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.

View details
65
Repo Health
81
Technical
61
Dependency
Built with
Python 59%
Jupyter Notebook 21%
Updated 4 days ago
Python
62%
MIT

AutoGen

AI Development · Automation

61,331

Build autonomous and human-in-the-loop multi-agent AI systems with a layered, event-driven Python and .NET framework pioneered at Microsoft Research.

View details
55
Repo Health
78
Technical
73
Dependency
Built with
Python 62%
C# 25%
TypeScript 12%
Updated 5 months ago
Python
67%
Other

AutoGPT

AI Assistants · Automation · Productivity

187,500

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
66
Dependency
Built with
Python 67%
TypeScript 32%
Updated today
TypeScript
48%
AGPL 3.0

Banana Slides

AI Design Tools · Productivity

15,725

AI-native PPT generator with Vibe editing, multi-LLM support, and fully editable PPTX export

View details
83
Repo Health
82
Technical
71
Dependency
Built with
TypeScript 48%
Python 47%
Updated 2 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers