Skip to main content

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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plexi-sdk 0.3.2
File Size Uploaded
plexi_sdk-0.3.2.tar.gz 67.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plexi-sdk 0.3.2
File Interpreter ABI Platform
plexi_sdk-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 144.0 kB

Release files / plexi_sdk-0.3.2.tar.gz

Download URL plexi_sdk-0.3.2.tar.gz
Size 67.0 kB
Tags Source
SHA-256 checksum
How to use checksums
806e1d420804ece1494e195daf6efbbbf1554418355d09c107ef10158bbd86e0
BLAKE2b-256 checksum
How to use checksums
a976d81247fbeded23ad90ed5cc78343b51c557631065b6b640f4c2b399506e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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.2-py3-none-any.whl

Download URL plexi_sdk-0.3.2-py3-none-any.whl
Size 77.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73b2e0114be9d2b9c7ae041db380281cd7cd10eaf3673c94df55e51aa416d1af
BLAKE2b-256 checksum
How to use checksums
e39e4ee051c6f614c1bbf776c56b52e9318e6ad3244cb8d68619659179a466f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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 history Release notifications | RSS feed

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

This release

0.3.2 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.11

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.5

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page