rich

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

Library
PyPI
v15.0.0
57,276stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
63/100Good
Development Activity32
Maintenance56
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
89/100Excellent
Architecture85
Code Quality88
Innovation92
Learning Curve90

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 printfrom 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 43 apps in this directory

Python
98%
MIT

Agent Lightning

AI Development

17,917

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
83
Repo Health
68
Technical
69
Dependency
Built with
Python98%
Updated 2 days ago
Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,969

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
Python100%
Updated today
Python
50%
Other

Airbyte

Developer Tools · Data Engineering

21,971

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
67
Dependency
Built with
Python50%
Kotlin41%
Updated today
Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,645

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
65
Dependency
Built with
Python90%
Updated today
Python
76%
MIT

ArchiveBox

Bookmarks Archiving

28,207

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
70
Dependency
Built with
Python76%
HTML12%
Updated today
Python
59%
Apache 2.0

argilla

AI Development · Data Engineering

5,088

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
Python59%
Jupyter Notebook21%
Updated 6 days ago
Python
62%
MIT

AutoGen

AI Development · Automation

60,698

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
56
Repo Health
78
Technical
74
Dependency
Built with
Python62%
C#25%
TypeScript12%
Updated 4 months ago
Python
67%
Other

AutoGPT

Automation · Productivity · AI Assistants

186,997

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
67
Dependency
Built with
Python67%
TypeScript31%
Updated today
TypeScript
49%
AGPL 3.0

Banana Slides

AI Design Tools · Productivity

15,520

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

View details
84
Repo Health
82
Technical
71
Dependency
Built with
TypeScript49%
Python46%
Updated today

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

Search