rstui
Python child SDK for the rstui graphical terminal runtime.
python3 -m pip install rstui
cargo install rstui
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:
rstui run -- python3 app.py
stdout is reserved for the framed protocol. Write diagnostics to stderr.
Adaptive Matplotlib dashboard
Install the optional adapter and define only the grid, spans, and panel content:
python3 -m pip install 'rstui[matplotlib]'
from rstui import run
from rstui.matplotlib import Dashboard, Panel
def draw_chart(panel):
axes = panel.axes()
axes.plot([0, 1], [0, 1])
def draw_details(panel):
axes = panel.axes()
axes.set_axis_off()
axes.text(0, 1, "Ready", va="top")
def on_event(event, context):
return "render" if event["type"] in {"start", "resize"} else "continue"
page = Dashboard(
columns=(2, 1),
rows=(1,),
panels=(
Panel("chart", draw_chart, row=0, column=0, title="Chart"),
Panel("details", draw_details, row=0, column=1, title="Details"),
),
)
run(on_event, page.render)
panel.axes() is already constrained to that panel. Full-screen pixels,
terminal cells, resize, borders, titles, and framebuffer placement remain rstui
responsibilities. Use Insets only when a chart needs extra panel-local room
for tick labels.
Project: https://github.com/maokangkun/Terminal/tree/main/rstui
Release files for rstui 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rstui-0.2.2.tar.gz | 10.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rstui-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.8 kB
Release files / rstui-0.2.2.tar.gz
| Download URL | rstui-0.2.2.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17790222a645dc99b55d9de12866353dd921de89e7046145016d05c728bd617a
|
|
BLAKE2b-256 checksum How to use checksums |
8e11a245075af71446b06caeb255a8e4e1ec77d0ad37208921f82323223383ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / rstui-0.2.2-py3-none-any.whl
| Download URL | rstui-0.2.2-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
edba7b302773bfaf8409e47297d6191561c7b17a12b612c3fe1d799afdfd6c7c
|
|
BLAKE2b-256 checksum How to use checksums |
47616604cd782aa1a02c84241a049139f2bb7feb54c7fa5778cd2a6fec482f37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|