Skip to main content

Python SDK v3 for Plexi apps running through native ProcessApp

Project description

plexi-sdk

Python SDK v3 for building Plexi apps running through native ProcessApp.

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:

#!/usr/bin/env python3
from __future__ import annotations

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
plexi app check myapp --png-dir /tmp/myapp-shots
plexi app open myapp

Generates myapp/main.py, myapp/manifest.toml, myapp/tests/test_app.py, and a per-app .venv/ for Python isolation. plexi app check validates the SDK v3 shape, renders the size matrix, and can write PNG snapshots for visual review.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plexi_sdk-0.1.14.tar.gz (54.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plexi_sdk-0.1.14-py3-none-any.whl (63.0 kB view details)

Uploaded Python 3

File details

Details for the file plexi_sdk-0.1.14.tar.gz.

File metadata

  • Download URL: plexi_sdk-0.1.14.tar.gz
  • Upload date:
  • Size: 54.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","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}

File hashes

Hashes for plexi_sdk-0.1.14.tar.gz
Algorithm Hash digest
SHA256 bfee31ec6348505990e38725544b1ac769263e2028c75440bfcdc87664681901
MD5 7e4ab73fe182ee9008b996bfe9ae1a8b
BLAKE2b-256 3d46b1c3e710333010631a1ff4a04097b72b27a8d3b45d758db31233b763b9c5

See more details on using hashes here.

File details

Details for the file plexi_sdk-0.1.14-py3-none-any.whl.

File metadata

  • Download URL: plexi_sdk-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 63.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","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}

File hashes

Hashes for plexi_sdk-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 b0ef813c2e9f0c130a15eaf88d1256625474307a04847c6b3f375421f12c4748
MD5 4f92a7828b7bd84109653398743d40bf
BLAKE2b-256 a2af50948bf962690c89fa026e04ebd728210304380b043788b948a40ea1cc92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page