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.2.0
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.2.0.tar.gz | 67.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| plexi_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 144.7 kB
Release files / plexi_sdk-0.2.0.tar.gz
| Download URL | plexi_sdk-0.2.0.tar.gz |
|---|---|
| Size | 67.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e4511da0df9d7ec9203c5ed2de4d38601fdc989711944e10bf436371212b8dd
|
|
BLAKE2b-256 checksum How to use checksums |
91217c3da00b198369f4b393375a882acf6112891ce5eb4b2ee0df2c0036de93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.2.0-py3-none-any.whl
| Download URL | plexi_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 77.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d0c8ad9d62e76b15fcdbc83afb1f0d06c82da289b1155f4c7a8eb17da347363
|
|
BLAKE2b-256 checksum How to use checksums |
6cf720f602d18451bf9eada79fabd8351a44df887b16ae3679b3159bd53efdd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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}
|