janelkit-desktop
Servicios del sistema para aplicaciones JanelKit: diálogos nativos, portapapeles y notificaciones, con await y sin bloquear la ventana.
pip install janelkit-desktop
En un minuto
from janelkit_desktop import clipboard, dialogs, notify
async def abrir():
ruta = await dialogs.open_file("Abrir nota", filters=["Texto (*.txt *.md)"])
if ruta is not None: # None si el usuario cancela
texto.value = ruta.read_text()
async def borrar():
if await dialogs.confirm("¿Borrar la nota?"):
...
def copiar():
clipboard.copy(texto.value)
notify("Copiado", "La nota está en el portapapeles")
<Button on:click={abrir}>Abrir…</Button>
<Text>En el portapapeles: {clipboard.paste()}</Text>
Características
- Diálogos nativos y asíncronos. Abrir, guardar, elegir carpeta, mensaje y confirmación. Se esperan con
await: la ventana sigue respondiendo y el resultado llega comoPath, una lista,booloNonesi se cancela. - Portapapeles reactivo.
clipboard.paste()en la plantilla se actualiza cuando cambia el portapapeles, también si cambia desde otra aplicación. - Notificaciones del sistema. Con icono en la bandeja. Al pulsar una, la ventana pasa al frente y se llama a
on_click. - Fácil de probar. Añade métodos a
janelkit.inspectpara responder diálogos y leer notificaciones en las pruebas, sin ventanas reales. - Solo API pública. Usa
janelkityjanelkit.ext, nada interno del núcleo; una prueba del repositorio lo comprueba.
Referencia
| Nombre | Descripción |
|---|---|
dialogs |
Diálogos del sistema, todos asíncronos (await): open_file, open_files, save_file y choose_folder (devuelven Path, una lista o None si se cancela), message y confirm (devuelve bool). Para pruebas, pending() lista los abiertos y kind(d) dice el tipo de uno ("MessageDialog", "FileDialog", "FolderDialog"). |
clipboard |
Portapapeles del sistema (texto): copy(texto), paste() (el texto que hay, o "" si no hay nada; reactivo) y clear(). |
notify |
notify(título, mensaje="", on_click=None) muestra una notificación del sistema. Donde no hay bandeja no se ve, pero queda registrada. |
Las tres piezas necesitan una aplicación en marcha.
En pruebas
Al importarse, el paquete añade estos métodos a MountedApp de janelkit.inspect:
| Método | Descripción |
|---|---|
app.dialogs() |
Diálogos abiertos, del más antiguo al más reciente. |
app.answer_dialog(resultado) |
Responde al último: una ruta (archivos o carpeta), True (aceptar) o False (cancelar). |
app.notifications() |
Notificaciones enviadas ({"title", "message"}), de la más antigua a la más reciente. |
from janelkit import inspect
def test_borrar_pregunta_antes():
with inspect.mount("src/App.janel") as app:
app.find(text="Borrar").click()
app.answer_dialog(False) # el usuario cancela
assert app.find(text="Mi nota")
Ejemplos: apps/examples/files (elegir carpeta), apps/challenges/gestor (confirmaciones) y apps/challenges/chat (notificaciones).
Compatibilidad
| janelkit-desktop | janelkit | Python |
|---|---|---|
| 0.1.x | ≥ 0.1, < 0.2 | ≥ 3.10 |
Sigue la misma política de versiones que el núcleo, con versión propia.
Cambios
0.1.0
- Primera versión publicada. Antes eran los módulos
janelkit.dialogs,janelkit.clipboardyjanelkit.notificationsdel núcleo: cambiafrom janelkit import dialogs, clipboard, notifyporfrom janelkit_desktop import dialogs, clipboard, notify. - Compatible con
janelkit0.1 (janelkit>=0.1,<0.2).
Licencia
MIT.
Metadata
Release files for janelkit-desktop 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| janelkit_desktop-0.1.0.tar.gz | 13.4 kB | With provenance | Details for janelkit_desktop-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| janelkit_desktop-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for janelkit_desktop-0.1.0-py3-none-any.whl |
Total release size: 24.8 kB
Release files / janelkit_desktop-0.1.0.tar.gz
| Download URL | janelkit_desktop-0.1.0.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65f69fddc81f41e07365013cf08b3840ab928c0490bda32f69faf8fdd2a3d375
|
|
BLAKE2b-256 checksum How to use checksums |
d8683d741a8166a12af06da8ed5e521ad5c3b568d725d533891c2d2560f3d628
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / janelkit_desktop-0.1.0-py3-none-any.whl
| Download URL | janelkit_desktop-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74c0633104d18f089bb22df2541799e60c72e5c49c0e8ba919f36515609080ae
|
|
BLAKE2b-256 checksum How to use checksums |
8cabfba00160b65d156d51dfdab277abeea49c795abea7695096ca37326b8af8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logSecurity for janelkit-desktop 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for janelkit_desktop-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.