Python SDK for the rstui graphical terminal runtime
Project description
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])
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
Project details
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 rstui-0.2.0.tar.gz.
File metadata
- Download URL: rstui-0.2.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a78b9591de51d477bd007d6d48e11e55125b5448c5cc8ca9b8f2c7bc164b62fe
|
|
| MD5 |
7f95b616a2bd5653417c78a3c87b65fe
|
|
| BLAKE2b-256 |
be3f051fddd421b802ea9aef0f39b0d5bdb0bbcdbd1e415df9ccb0b7091117ac
|
File details
Details for the file rstui-0.2.0-py3-none-any.whl.
File metadata
- Download URL: rstui-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d804afa8df316d79cde4a80c4f19ecfb6f396a408c71be148fd2ea6264e9ecd
|
|
| MD5 |
6c24a429df62f4f1daee93fcbdbcdb02
|
|
| BLAKE2b-256 |
286a2fa5415a5583353f68986575d15fe83a9f442de0ecde505b86e8233a68f5
|