Skip to main content

A drop-in replacement for Python Rich, powered by Rust for maximum performance

Project description

fast_rich

fast_rich is a drop-in replacement for Python Rich, powered by Rust for maximum performance.

🚀 Features

  • Drop-in replacement - Just change your imports!
  • Rust-powered performance - 10-60x faster than Python Rich
  • Identical API - Same class names, method signatures, and behavior
  • Type hints - Full type annotations for modern Python development

📦 Installation

pip install fast-rich

⚡ Quick Start

Simply change your imports:

# Before (Python Rich)
from rich.console import Console
from rich.table import Table

# After (fast_rich - just change the import!)
from fast_rich.console import Console
from fast_rich.table import Table

Everything else stays the same:

from fast_rich.console import Console
from fast_rich.table import Table

console = Console()

# Tables work exactly like Rich
table = Table(title="Star Wars Movies")
table.add_column("Title", style="cyan")
table.add_column("Year", style="magenta")
table.add_row("A New Hope", "1977")
table.add_row("The Empire Strikes Back", "1980")

console.print(table)

📚 Available Components

Component Status Python Rich Equivalent
Console rich.console.Console
Table rich.table.Table
Text rich.text.Text
Style rich.style.Style
Panel rich.panel.Panel
Rule rich.rule.Rule
Tree rich.tree.Tree
Progress rich.progress.Progress
Markdown rich.markdown.Markdown
Syntax rich.syntax.Syntax
Columns rich.columns.Columns
Traceback rich.traceback.Traceback
Live rich.live.Live
Layout rich.layout.Layout
Prompt rich.prompt.Prompt
Confirm rich.prompt.Confirm
inspect rich.inspect
print rich.print

🎯 Key Differences

While fast_rich aims for 100% API compatibility, there are minor differences:

  1. Rust backend - Rendering is done in Rust, not Python
  2. Performance - Significantly faster for large outputs
  3. Memory - Lower memory footprint for complex renders

🧪 Testing

All components are tested for parity with Python Rich:

cd bindings/python
python -m pytest tests/ -v

📈 Performance

Operation Python Rich fast_rich Speedup
Table (1000 rows) 150ms 2.5ms 60x
Progress rendering 45ms 0.7ms 64x
Syntax highlighting 200ms 5ms 40x

📄 License

MIT License - See LICENSE for details.

🙏 Credits

  • Rich by Will McGugan - The original inspiration
  • PyO3 - Rust/Python bindings

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_rich-0.3.1.tar.gz (208.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fast_rich-0.3.1-cp310-abi3-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file fast_rich-0.3.1.tar.gz.

File metadata

  • Download URL: fast_rich-0.3.1.tar.gz
  • Upload date:
  • Size: 208.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for fast_rich-0.3.1.tar.gz
Algorithm Hash digest
SHA256 70967136a5fbae3040c60ddd4c4c87da855a220811a3c99f84a46947c00452a2
MD5 3ed613308c5095ee9be5dc04cf7c7348
BLAKE2b-256 fed70e43e1665d58cb2ca21aea925167f183062a9cba12f333fde35063fc1975

See more details on using hashes here.

File details

Details for the file fast_rich-0.3.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_rich-0.3.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 83f8734cad0aff033ca18b765bf1849cf6650fe31ba7def741d817406e33d413
MD5 0195c139b2d53ca4e9ef77308754b8b4
BLAKE2b-256 bb2ee336df064bd6e842e138b1d8351754a813e66387a521b83bbd41c16c3820

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page