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.

Develop

Create and live-run a Python applet project with the Glimpse tooling:

glimpse-applet new counter --lang python
cd counter
glimpse-applet dev

Read docs/custom-applets/tooling.md for project layout, applet.toml, dev applets, local linking, distribution, and diagnostics.

Goals

  • typed protocol models
  • typed widget builders
  • async runtime
  • widget callbacks such as Button(on_click=...), plus decorator-based callbacks for explicit ids
  • 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,
    StatusItem,
    Label,
)


@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(label="Version"),
                Button(
                    label="Deploy now",
                    on_click=self.on_deploy,
                    icon="media-playback-start-symbolic",
                    variant=ButtonVariant.PRIMARY,
                ),
            ]
        )

    async def on_deploy(self, state: DeployState, _event) -> None:
        await self.set_state(status="Deploying")


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

IPC client

Talk to a running Glimpse daemon: subscribe to event channels and dispatch actions. ipc(service) only resolves the socket path — the connection is opened lazily.

import glimpse_sdk

sub = glimpse_sdk.ipc(service="shell")  # "shell" | "wallpaper" | "idle" | "lock"

# Fire an action; awaits the ack, raises IpcError if the server rejects it.
ack = await sub.dispatch("open_uri", {"uri": "https://example.com"})

# Stream events until the socket closes.
async for ev in sub.listen("audio.*"):
    print(ev.name, ev.fields)

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.8.0.tar.gz (13.7 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.8.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glimpse_applet_sdk-0.8.0.tar.gz
  • Upload date:
  • Size: 13.7 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.8.0.tar.gz
Algorithm Hash digest
SHA256 c868f13cd1732194629746bad4d949cc9ea45f14e8ed082c0d30007f231372b3
MD5 5cbcb7f3a44d31994cc364ab48bca7b8
BLAKE2b-256 b6e38f80da27fdfee1387b55edae1286cc7357f4036590afe073a2940de7e1f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for glimpse_applet_sdk-0.8.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.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for glimpse_applet_sdk-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac920f0a4ab093dcb6aaf94568a55e3141b4e2c0bf54d31001bcd6a09950bbcb
MD5 2c5f00c5ac3103feb7fe2d1401889010
BLAKE2b-256 39db120173072455838dff8bda76caa5ca89f132efc5dd9a1388867805c98ee1

See more details on using hashes here.

Provenance

The following attestation bundles were made for glimpse_applet_sdk-0.8.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