Fast-Rich
[!IMPORTANT] This project is currently in Alpha. APIs are subject to change, and some features may be incomplete.
Fast-Rich is a Rust port of Python's popular Rich library. It empowers your terminal applications with rich text, tables, syntax highlighting, markdown rendering, and more, all with an idiomatic and safe Rust API.
Features
- Rich Text: Use styled text with bold, italic, underline, and RGB/TrueColor support.
- Tables: Render beautiful tables with Unicode borders, column alignment, and auto-sizing.
- Progress Bars: Track tasks with multi-bar support, spinners, ETA, and customizable columns.
- Live Display: Create flicker-free, auto-updating displays for dashboards and dynamic content.
- Syntax Highlighting: Highlight code snippets using
syntectwith multiple themes (Monokai, Solarized, etc.). - Markdown: Render Markdown content (headers, lists, code blocks, blockquotes) directly in the terminal.
- Hierarchical Data: Display tree structures and nested data.
- Beautiful Logging: structured, colored, and timestamped logging compatible with the
logcrate. - Layouts: Split the screen into customizable layouts (vertical, horizontal, nested).
- Panels & Rules: Organize content with bordered panels and horizontal rules.
Installation
Add fast-rich to your Cargo.toml:
[]
= "0.2.0"
To enable all features (including Syntax Highlighting and Markdown, which bring in extra dependencies):
[]
= { = "0.2.0", = ["full"] }
Or pick specific features:
[]
= { = "0.2.0", = ["syntax", "markdown", "logging"] }
Quick Start
use *;
Documentation
Examples
Run the included examples to see features in action:
Comparisons
| Feature | Python Rich | Fast-Rich |
|---|---|---|
| Rich Text | ✅ | ✅ |
| Tables | ✅ | ✅ |
| Progress | ✅ | ✅ |
| Live Display | ✅ | ✅ |
| Syntax Highlighting | ✅ | ✅ |
| Markdown | ✅ | ✅ |
| Layouts | ✅ | ✅ |
| Tracebacks | ✅ | ✅ |
| Inspect | ✅ | ✅ |
Contributing
Contributions are welcome! Please check out CONTRIBUTING.md for guidelines on how to get started.
License
MIT or Apache-2.0