Metadata-Version: 2.4
Name: rstui
Version: 0.1.0
Summary: Python SDK for the rstui graphical terminal runtime
Project-URL: Homepage, https://github.com/maokangkun/Terminal/tree/main/rstui
Project-URL: Repository, https://github.com/maokangkun/Terminal
Project-URL: Issues, https://github.com/maokangkun/Terminal/issues
Author: maokangkun
License-Expression: Apache-2.0
License-File: LICENSE-APACHE
Keywords: graphics,rgba,sixel,terminal,tui
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Terminals
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# rstui

Python child SDK for the `rstui` graphical terminal runtime.

```sh
python3 -m pip install rstui
cargo install rstui
```

```python
from rstui import Frame, run

def on_event(event, context):
    return "render" if event["type"] == "start" else "continue"

def render(context):
    width = context["geometry"]["pixel_width"]
    height = context["geometry"]["pixel_height"]
    return Frame(width, height, bytes(width * height * 4))

run(on_event, render)
```

Run the application with:

```sh
rstui run -- python3 app.py
```

stdout is reserved for the framed protocol. Write diagnostics to stderr.

Project: https://github.com/maokangkun/Terminal/tree/main/rstui
