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

Uploaded Python 3

File details

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

File metadata

  • Download URL: plexi_sdk-0.1.11.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.11.tar.gz
Algorithm Hash digest
SHA256 9bbfddbcda2559a321ee5d17a991b3303f16975454c3ecfdbffaa83e92102903
MD5 f998e8435b39c9e34f4b2225e25bc928
BLAKE2b-256 77de720e5476bf683a474545f2ff6bc0d835f05f82ae7d260d7fc458cb3d8711

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plexi_sdk-0.1.11-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.11-py3-none-any.whl
Algorithm Hash digest
SHA256 9d3be63207f6181764c0368d27dcf7355647a815571d12b0600e6287c665edee
MD5 a3594a091c98edda9a9d6fea02f3fbaa
BLAKE2b-256 cfb0fcff399e913fae43a61ed6adb3f3d65766b74755699211612c40d1db9031

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