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)andpopover(state)methods; state mutation viaawait 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82bc7eb90ac58061f9156f32aa1cd82b13a31399348e2d772934dfff03182f8c
|
|
| MD5 |
bfae0f86984183236520f2ffc5c400c2
|
|
| BLAKE2b-256 |
a81a419191ef1cfe9342f7514f1a0f609f99d8cbe3793a798c1f1cf273164bde
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glimpse_applet_sdk-0.5.0.tar.gz -
Subject digest:
82bc7eb90ac58061f9156f32aa1cd82b13a31399348e2d772934dfff03182f8c - Sigstore transparency entry: 1553584904
- Sigstore integration time:
-
Permalink:
alex-oleshkevich/glimpse@930507cc39ceb8f3f29ccc370545d39d7ad958aa -
Branch / Tag:
refs/tags/sdk-py-v0.5.0 - Owner: https://github.com/alex-oleshkevich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk-py.yml@930507cc39ceb8f3f29ccc370545d39d7ad958aa -
Trigger Event:
push
-
Statement type:
File details
Details for the file glimpse_applet_sdk-0.5.0-py3-none-any.whl.
File metadata
- Download URL: glimpse_applet_sdk-0.5.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12c2f123613051e7194be029533febbfc18b9eb26f9810f72725bf2e1caa01b6
|
|
| MD5 |
af44fd8eb86a0e805d6f4242425fd17e
|
|
| BLAKE2b-256 |
d9fc5b55b89aa6453770e5501b6fe650228d6479ed6ede292a0a341b4665d1e2
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glimpse_applet_sdk-0.5.0-py3-none-any.whl -
Subject digest:
12c2f123613051e7194be029533febbfc18b9eb26f9810f72725bf2e1caa01b6 - Sigstore transparency entry: 1553584908
- Sigstore integration time:
-
Permalink:
alex-oleshkevich/glimpse@930507cc39ceb8f3f29ccc370545d39d7ad958aa -
Branch / Tag:
refs/tags/sdk-py-v0.5.0 - Owner: https://github.com/alex-oleshkevich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk-py.yml@930507cc39ceb8f3f29ccc370545d39d7ad958aa -
Trigger Event:
push
-
Statement type: