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:
- Rust backend - Rendering is done in Rust, not Python
- Performance - Significantly faster for large outputs
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_rich-0.3.0.tar.gz.
File metadata
- Download URL: fast_rich-0.3.0.tar.gz
- Upload date:
- Size: 207.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90ca217d2d284421052d9a367e7114987218ebd976670074b1f9485f04810627
|
|
| MD5 |
d8db4d653e07d791e3583ba6f8a9603f
|
|
| BLAKE2b-256 |
16aaaf6bd62bc10a4044baab14b9d91c1fea8afef9ad6a91283f3b240d5f286d
|
File details
Details for the file fast_rich-0.3.0-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: fast_rich-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca63562ed610f89270a122887826ff923a6fa5219549447dadd8ee0dd524db9e
|
|
| MD5 |
449e9613e802dfa6e63b0b23182e1d5a
|
|
| BLAKE2b-256 |
1519c5b30cc84abbe38ede4c0205dd1ebd8188d31ed977ffd282e1df988ecccc
|