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.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.3.0.tar.gz | 65.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| plexi_sdk-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 140.1 kB
Release files / plexi_sdk-0.3.0.tar.gz
| Download URL | plexi_sdk-0.3.0.tar.gz |
|---|---|
| Size | 65.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95dbc964a3ba798bd7d25e51fd7005face2748cd8c801295a84b68751a25fb80
|
|
BLAKE2b-256 checksum How to use checksums |
c9d100c4808e8b83c8880fdd41958e6d72bc8cae6ba3a606ef54e54cf83f0fea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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.0-py3-none-any.whl
| Download URL | plexi_sdk-0.3.0-py3-none-any.whl |
|---|---|
| Size | 74.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55f36b323beb378c59653d52a413624c768889762125ee2a023353acc71b612f
|
|
BLAKE2b-256 checksum How to use checksums |
bed784ffd8a5dffb3ce2db351a96e06e961e2f82fc4803a42e3f7cc2f189dc0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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}
|