Python API¶
The fast_rich python package provides Drop-in-ish replacements for some Rich components, optimized for speed.
Installation¶
Components¶
Console¶
The entry point for printing.
Table¶
A high-performance table builder.
from fast_rich import Console, Table
table = Table()
table.add_column("ID")
table.add_column("Value")
for i in range(1000):
table.add_row([str(i), f"Value {i}"])
console = Console()
console.print_table(table)
Progress¶
A multi-threaded progress bar system.
from fast_rich import Progress
import time
progress = Progress()
task_id = progress.add_task("Downloading...", total=100)
for i in range(100):
progress.update(task_id, i + 1)
time.sleep(0.05)
Performance¶
fast-rich is designed to handle massive amounts of data. Use it when:
- You have > 10,000 rows in a table.
- You are constrained by Python's render overhead.
- You need to verify Rust library correctness from Python.