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

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.4
File Size Uploaded
plexi_sdk-0.3.4.tar.gz 67.0 kB Details

Built distribution (wheel)

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

Total release size: 144.0 kB

Release files / plexi_sdk-0.3.4.tar.gz

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

Download URL plexi_sdk-0.3.4-py3-none-any.whl
Size 77.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1db84583aa56868d5debcbe811690eb30e5bdc6bebbd3714e7459f887fa8e27c
BLAKE2b-256 checksum
How to use checksums
93d088f33523382f39168eac2d7f3b35e8fef9e8a287cc1a22ab2e345d103126
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","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

This release

0.3.4 This release

2 release files

0.3.2

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