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

Uploaded Python 3

File details

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

File metadata

  • Download URL: plexi_sdk-0.1.15.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.15.tar.gz
Algorithm Hash digest
SHA256 a813e4a90067039488043cc887b2517cc6f43695d8d71e4bc34562c15fb385dd
MD5 5bd74155f9f6c262d3d34de78632f6da
BLAKE2b-256 a8a2c6a5fc9865cef30471ab920fd4343934cb19fb7889ccdc88adf71c43e1d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plexi_sdk-0.1.15-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.15-py3-none-any.whl
Algorithm Hash digest
SHA256 80f6197942c61bfb68c2a304fea37a73efcf79fc09bcb5164d5a3735a565493a
MD5 8195ccc88965a633ba46b47b87f0e480
BLAKE2b-256 a63f54fe67301a83d2534b178b52459f56e051b6a8134390ae2173a0a1f393d9

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