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, linking, and diagnostics.

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()

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.5.0.tar.gz (12.1 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.5.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glimpse_applet_sdk-0.5.0.tar.gz
  • Upload date:
  • Size: 12.1 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.5.0.tar.gz
Algorithm Hash digest
SHA256 82bc7eb90ac58061f9156f32aa1cd82b13a31399348e2d772934dfff03182f8c
MD5 bfae0f86984183236520f2ffc5c400c2
BLAKE2b-256 a81a419191ef1cfe9342f7514f1a0f609f99d8cbe3793a798c1f1cf273164bde

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for glimpse_applet_sdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12c2f123613051e7194be029533febbfc18b9eb26f9810f72725bf2e1caa01b6
MD5 af44fd8eb86a0e805d6f4242425fd17e
BLAKE2b-256 d9fc5b55b89aa6453770e5501b6fe650228d6479ed6ede292a0a341b4665d1e2

See more details on using hashes here.

Provenance

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