plexi-sdk
Python SDK v3 for building Plexi apps running inside the CPython-in-WASM runtime.
Full design spec: SDK_V3.md
Install For SDK Development
uv pip install -e ./sdk/python
Changes to sdk/python/plexi_sdk/ take effect immediately.
App Pattern
An app is three module-level functions:
from plexi_sdk import state
from plexi_sdk.effects import SetTitle, SetState
from plexi_sdk.events import KeyEvent
from plexi_sdk.ui import Column, AppBar, Text, FooterKeys
def init(size, args):
return [SetTitle("Counter"), SetState({"count": 0})]
def update(event):
if isinstance(event, KeyEvent) and event.key == "plus" and event.pressed:
return [SetState({"count": state.get("count", 0) + 1})]
return []
def view():
return Column([
AppBar("Counter"),
Text(str(state.get("count", 0)), bold=True, align="center"),
FooterKeys([("+", "increment")]),
], grow=True)
SetState is process-local runtime state. Use PersistState when a key must survive app restart.
Games and animations should return SetSchedulerMode("continuous", fps=60) from init() and update runtime state from RenderFrame events. Do not build animation loops with timers.
Keyboard Conventions
Keys arrive in update(event) as KeyEvent. Key strings are lowercase canonical.
| Physical key | event.key |
|---|---|
| Enter / Return | "return" |
| Escape | "escape" |
| Backspace | "backspace" |
| Space | "space" |
| Arrow keys | "up" / "down" / "left" / "right" |
New App
plexi app init myapp
Generates myapp/main.py + myapp/manifest.toml with python_compat = true.
Metadata
Release files for plexi-sdk 0.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| plexi_sdk-0.3.5.tar.gz | 67.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| plexi_sdk-0.3.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 144.0 kB
Release files / plexi_sdk-0.3.5.tar.gz
| Download URL | plexi_sdk-0.3.5.tar.gz |
|---|---|
| Size | 67.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
440f487f7f80c6898988677160b8811d97a4190b4d0a112eb189493a6e516fb7
|
|
BLAKE2b-256 checksum How to use checksums |
0dd2ff07128afb80f37364f8230537e7534c876e6414a9a62bc123410b2cef4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / plexi_sdk-0.3.5-py3-none-any.whl
| Download URL | plexi_sdk-0.3.5-py3-none-any.whl |
|---|---|
| Size | 77.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
222fbe3160bca802dc6e88633c484213bb41bf459e1e9199d573392c925b7f28
|
|
BLAKE2b-256 checksum How to use checksums |
cc43338eca85fc52c48204d99217ce4df0532dac429834ff1964648ccb3324ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|