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.13.tar.gz (52.6 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.13-py3-none-any.whl (61.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plexi_sdk-0.1.13.tar.gz
  • Upload date:
  • Size: 52.6 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.13.tar.gz
Algorithm Hash digest
SHA256 7c26ea0ac3c2e0953b6644049eb3beb55b86b3eeb2a3db9d3b83ab0d45d9043b
MD5 4e0f0b09afa83630af7c96990726debe
BLAKE2b-256 7a23d66df13de41a164967323bd33d75b9d3d6e3fbff7c2f88027984cdcfd6be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plexi_sdk-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 61.3 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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 7cd73c17ebcd1531817dbc48a9967a56eb5f2cd9fa6ae539ca5fa525d3dbcc8e
MD5 044c397a5fc515d1c2423f4c0e6c53c5
BLAKE2b-256 cb812b37f307f09be1f526c3e62dcd7ba371f3d7ed12474a1e98bbfd5896bb50

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