Metadata-Version: 2.4
Name: fast-rich
Version: 0.3.0
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Terminals
Classifier: Typing :: Typed
Requires-Dist: pytest>=7.0 ; extra == 'dev'
Requires-Dist: rich>=13.0 ; extra == 'dev'
Provides-Extra: dev
Summary: A drop-in replacement for Python Rich, powered by Rust for maximum performance
Keywords: terminal,console,rich,formatting,rust,fast
Author-email: Mohammad Albarham <mohammad.albarham@gmail.com>
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/mohammad-albarham/fast-rich
Project-URL: Repository, https://github.com/mohammad-albarham/fast-rich
Project-URL: Documentation, https://mohammad-albarham.github.io/fast-rich

# fast_rich

**fast_rich** is a drop-in replacement for [Python Rich](https://github.com/Textualize/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

```bash
pip install fast-rich
```

## ⚡ Quick Start

Simply change your imports:

```python
# 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:

```python
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:

```bash
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](../LICENSE) for details.

## 🙏 Credits

- [Rich](https://github.com/Textualize/rich) by Will McGugan - The original inspiration
- [PyO3](https://pyo3.rs/) - Rust/Python bindings

