Metadata-Version: 2.4
Name: rs-rich
Version: 0.0.2
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Rust
Classifier: Topic :: Terminals
Summary: Rich-compatible terminal rendering, backed by the rs-rich Rust port
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://buchochelliq-labs.github.io/rs-rich-cli/python/
Project-URL: Repository, https://github.com/buchochelliq-labs/rs-rich-cli

# rs-rich (Python)

Rich-compatible terminal rendering for Python, backed by
[rs-rich](https://github.com/buchochelliq-labs/rs-rich-cli), a Rust port of
[Rich](https://github.com/Textualize/rich).

```bash
pip install rs-rich
```

Documentation: <https://buchochelliq-labs.github.io/rs-rich-cli/python/>, with a
[getting started guide](https://buchochelliq-labs.github.io/rs-rich-cli/python/getting-started/)
and an API reference for every module.

Move a Rich program over by changing its imports:

```python
from rs_rich.console import Console   # was: from rich.console import Console
from rs_rich.table import Table       # was: from rich.table import Table

table = Table(title="Star Wars Movies")
table.add_column("Released", justify="right", style="cyan", no_wrap=True)
table.add_column("Title", style="magenta")
table.add_row("Dec 20, 2019", "Star Wars: The Rise of Skywalker")

console = Console()
console.print(table)
```

All rendering happens in Rust. The Python package only maps Rich's classes
and arguments onto the Rust ones, so output matches Rich 15.0.0 byte for
byte (the documentation's Python section lists the few known differences).
What the port cannot do (Jupyter output, a handful of `Table` options) raises
`NotImplementedError` rather than rendering something different.

## What is in it

| | Modules |
|---|---|
| All of Rich's API | `rs_rich` (`print`, `print_json`, `inspect`, ...), `console`, `text`, `style`, `color`, `theme`, `markup`, `emoji`, `segment`, `measure`, `box`, `errors`, `terminal_theme`, `table`, `panel`, `rule`, `padding`, `align`, `constrain`, `styled`, `bar`, `spinner`, `columns`, `containers`, `layout`, `tree`, `markdown`, `syntax`, `pretty`, `json`, `highlighter`, `traceback`, `live`, `live_render`, `status`, `screen`, `pager`, `progress`, `progress_bar`, `prompt`, `logging` |
| rs-rich's extensions | `rs_rich.ext` and its 39 submodules: diagnostics, structured data, diffs and test reports, transforms, workflows, tables and badges, terminal capabilities, frames, inspectors, live layouts, CLI docs, testing and QA |
| Interactive components | `rs_rich.interact`: fuzzy `Select` and `MultiSelect`, `Input`, `Confirm`, `Form` and `Pager`, run on the terminal or headless (scripted keys in, frames out), with a fuzzy matcher |
| Images and diagrams | `rs_rich.art` (images, Sixel, FIGlet, GIFs, image diffs; Pillow images when Pillow is installed), `rs_rich.mermaid` |
| Plugins | `rs_rich.plugins`: write highlighters, code highlighters, themes, boxes, renderers, fence renderers and transforms in Python, checked by the Rust plugin host |
| The command line | `python -m rs_rich` and the `rich-rs` script: rs-rich's `rich` command, with `choose`, `filter`, `input`, `confirm` and `pager` |

Your own classes render through `__rich__`, `__rich_console__` and
`__rich_measure__`, anywhere a renderable goes.

The `lumis` (tree-sitter) code highlighter is a separate build
(`maturin build --features lumis`), and Mermaid's `mmdc` backend needs
`--features mmdc` and Mermaid's own CLI.

## Versions

The package has its own version (0.0.2) and is released from `python-v…`
tags. It bundles the rs-rich Rust crate from the same commit.

