Skip to main content

Typed async framework for Glimpse exec applets

Project description

Glimpse Applet Python SDK

Small async framework for building Glimpse exec applets without touching stdio or raw JSON.

Requires Python 3.14+.

Install

pip install glimpse-applet-sdk
# or with uv:
uv add glimpse-applet-sdk

The distribution is named glimpse-applet-sdk on PyPI; the import name is glimpse_sdk.

Goals

  • typed protocol models
  • typed widget builders
  • async runtime
  • decorator-based callbacks (@click, @scroll, @input, @change, @toggle)
  • separate status(state) and popover(state) methods; state mutation via await self.set_state(...)

Example

from dataclasses import dataclass

from glimpse_sdk import (
    Applet,
    AppletState,
    Box,
    Button,
    ButtonVariant,
    Hero,
    Icon,
    Label,
    StatusItem,
    click,
)


@dataclass
class DeployState(AppletState):
    version: str = "2026.04.07"
    status: str = "Ready"


class DeployApplet(Applet[DeployState]):
    def initial_state(self) -> DeployState:
        return DeployState()

    async def status(self, state: DeployState):
        return [
            StatusItem(
                id="deploy",
                icon=Icon.name("software-update-available-symbolic"),
                label=state.status,
            )
        ]

    async def popover(self, state: DeployState):
        return Box.vertical(
            [
                Hero(
                    icon=Icon.name("software-update-available-symbolic"),
                    title="Deploy",
                    subtitle=state.version,
                ),
                Label(text="Version"),
                Button(
                    id="deploy_now",
                    label="Deploy now",
                    icon="media-playback-start-symbolic",
                    variant=ButtonVariant.PRIMARY,
                ),
            ]
        )

    @click("deploy_now")
    async def on_deploy(self, _event) -> None:
        await self.set_state(status="Deploying")


if __name__ == "__main__":
    DeployApplet().run()

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

glimpse_applet_sdk-0.3.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glimpse_applet_sdk-0.3.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file glimpse_applet_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: glimpse_applet_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for glimpse_applet_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 52a3903aa7a778288356b1fce9a93ca5db7cf81ec368a09d37c93fa99e4b0bfb
MD5 8ce5ae91b65b3880d9c2577dedee2e2a
BLAKE2b-256 cbefb12406a341bf6de0142b4d5c456626c8e1a5b575a75b757f7885594e7e3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for glimpse_applet_sdk-0.3.0.tar.gz:

Publisher: release-sdk-py.yml on alex-oleshkevich/glimpse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file glimpse_applet_sdk-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for glimpse_applet_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 223ffac36ea48fbfa3a9664da2b8c3c4b1aaae0669e135d4771a1318db921a76
MD5 1dd5c20f7790d051592d9a3624ee6a37
BLAKE2b-256 65407484833488ccc306800279e5110c89778fd78eeeaa4d985366d2f4144171

See more details on using hashes here.

Provenance

The following attestation bundles were made for glimpse_applet_sdk-0.3.0-py3-none-any.whl:

Publisher: release-sdk-py.yml on alex-oleshkevich/glimpse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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