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:

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 as a normal [app] type = "app" Python app.

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.8.tar.gz (52.5 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.8-py3-none-any.whl (61.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plexi_sdk-0.1.8.tar.gz
  • Upload date:
  • Size: 52.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.8.tar.gz
Algorithm Hash digest
SHA256 5c8b69e67849f4a745981ce1d19abacc304998d08ae26a6ddd00acc74255586b
MD5 8cde6f86baee993a17ce65255e33ecc9
BLAKE2b-256 ec5a8c8afd3ba175b8ebf1ddf392d3b0a2150c5b4f05ec8505fa27d72feaffb6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plexi_sdk-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 61.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 983d39b6fb7189a868fbf2050dbd94bc648189d1d69eae81b35e51ab4da57236
MD5 e7a48b1d0fc9e73a2ca281ea8990e7b9
BLAKE2b-256 938263fd821f24a12704b355e3c4477da9b7ce66d84c8755ebe5ead295b78c24

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