fast-rich 0.3.0

A Rust port of Python's Rich library for beautiful terminal formatting
Documentation

Crates.io Documentation License Build Status Status

High-performance Rust port of Python's popular Rich library.

Beautiful terminal formatting for Rust applications.

Fast-Rich Hero


[!IMPORTANT] This project is currently in Alpha. APIs are subject to change, and some features may be incomplete.

Fast-Rich empowers your terminal applications with rich text, tables, syntax highlighting, markdown rendering, and more, all with an idiomatic and safe Rust API.

Feature Showcase

Experience the library's breadth with our automated demonstration:

Fast-Rich Showcase


🎨 Professional Assets

📊 Beautiful Tables

Unicode borders, automatic column alignment, and smart wrapping.

Tables

💻 Syntax Highlighting

Full support for various themes and languages via syntect.

Syntax

⏳ Progress Bars

Multi-threaded tracking with spinners, ETAs, and customizable columns.

Progress

📈 Live Dashboards

Flicker-free, auto-updating content for real-time monitoring.

Live

🌳 Structural Views

Render hierarchical data and layouts with ease.

Key Features

  • Rich Text: Use styled text with bold, italic, underline, and RGB/TrueColor support.
  • Markdown Rendering: Render headers, lists, and code blocks directly in your terminal.
  • Beautiful Logging: Structured, colored, and timestamped logging compatible with the log crate. Logging
  • Extensible API: Create your own renderables and custom style themes.

Installation

Add fast-rich to your Cargo.toml:

[dependencies]
fast-rich = "0.3.0"

To enable all features (including Syntax Highlighting and Markdown, which bring in extra dependencies):

[dependencies]
fast-rich = { version = "0.2.0", features = ["full"] }

Or pick specific features:

[dependencies]
fast-rich = { version = "0.2.0", features = ["syntax", "markdown", "logging"] }

Quick Start

use fast_rich::prelude::*;

fn main() {
    let console = Console::new();

    // Styled text using markup
    console.print("[bold red]Hello[/] [blue]World[/]!");

    // Create a table
    let mut table = Table::new();
    table.add_column("Features");
    table.add_column("Status");
    table.add_row_strs(&["Rich Text", "✅ Ready"]);
    table.add_row_strs(&["Tables", "✅ Ready"]);
    
    // Render the table
    console.print_renderable(&table);
}

Documentation

Examples

Run the included examples to see features in action:

cargo run --example showcase
cargo run --example syntax_highlighting --features syntax
cargo run --example live_clock
cargo run --example progress_rich
cargo run --example logging --features logging

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