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.9.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.9-py3-none-any.whl (61.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plexi_sdk-0.1.9.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.9.tar.gz
Algorithm Hash digest
SHA256 8e937f7ddab6c9837aacee1e976d5fbde805ae46c085ed64f76110f26d2f9253
MD5 cff9826a4fd6a50c6f6e25f43c99f675
BLAKE2b-256 94068b9ecaf7409a9fe60f59cfc6b7d591293f8adeaaaa7d1c35d713aa3fc3f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plexi_sdk-0.1.9-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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 aa5d8fb57abea301d0374832aed8fb8ca93ee775d21613aedecf8b477ccacd0e
MD5 23e692d81fa1ab8444221f59d5ffeed8
BLAKE2b-256 e7108bacf88f0ef83f925134094de7d6abd21731d067430f32d0227e6bfffde4

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