Skip to main content

deephaven-plugin-notification

Display OS-level system notifications from deephaven.ui using the browser's Notifications API.

Unlike toasts, notifications appear outside the browser window, so they can reach the user even when the Deephaven tab is not focused.

Install

pip install deephaven-plugin-notification

Restart the Deephaven server so the plugin is registered.

Usage

from deephaven import ui

from deephaven_plugin_notification import notification

btn = ui.button(
    "Show notification",
    on_press=lambda _e: notification("Query complete"),
    variant="primary",
)

notification is called directly — there is no hook to call and nothing to mount in the render tree.

Where you can call it

notification must run on the render thread: while a @ui.component renders, or from an event handler it triggered (like the on_press above). Calling it from the top level of a script or console, or from a background thread such as a table listener, raises NotificationError.

That is why every example below wraps the call in a handler or a component. To notify from a table listener, queue it with ui.use_render_queue() — see Notifying from a ticking table.

Permissions

Notifications require the user to grant permission before they can be displayed. The first time notification is called, the browser prompts the user to allow them. If the user denies permission, or notifications are not supported (for example, when the page is not served over a secure context such as HTTPS or localhost), the message is shown as a toast instead.

Content

The title is required. An optional description provides body text below the title, and icon may be a URL to an image.

from deephaven import ui

from deephaven_plugin_notification import notification

btn = ui.button(
    "Download",
    on_press=lambda _e: notification(
        "Download complete",
        description="Your file is ready to view.",
        icon="https://github.com/deephaven.png",
    ),
    variant="primary",
)

Events

on_click is called when the user clicks the notification, and on_close when it is dismissed. When the call falls back to a toast, on_click is exposed as an action button on the toast so the callback remains reachable.

from deephaven import ui

from deephaven_plugin_notification import notification

btn = ui.button(
    "Check for updates",
    on_press=lambda _e: notification(
        "An update is available",
        description="Click to install the latest version.",
        on_click=lambda: print("Clicked!"),
        on_close=lambda: print("Closed"),
    ),
    variant="primary",
)

Replacing notifications

Use tag to group related notifications. A new notification with the same tag replaces the existing one instead of stacking, which is useful for status or progress updates.

from deephaven import ui

from deephaven_plugin_notification import notification


@ui.component
def status_updater():
    def notify(message):
        notification(message, tag="job-status")

    return ui.button_group(
        ui.button("Start", on_press=lambda _e: notify("Job started")),
        ui.button("Finish", on_press=lambda _e: notify("Job finished")),
    )


my_status_updater = status_updater()

Silent notifications

Set silent=True to display a notification without any sound or vibration, regardless of the device's settings.

from deephaven import ui

from deephaven_plugin_notification import notification

btn = ui.button(
    "Save",
    on_press=lambda _e: notification("Saved", silent=True),
    variant="primary",
)

Notifying from a ticking table

A table listener fires on the update-graph thread, not the render thread, so the call must be queued with ui.use_render_queue(). Calling notification straight from the listener raises NotificationError.

from deephaven import time_table, ui

from deephaven_plugin_notification import notification

_source = time_table("PT5S").update("X = i").tail(5)


@ui.component
def notification_table(t):
    render_queue = ui.use_render_queue()

    def listener_function(update, is_replay):
        data_added = update.added()["X"][0]
        render_queue(lambda: notification(f"Added {data_added}", tag="table-update"))

    ui.use_table_listener(t, listener_function, [])
    return ui.table(t)


my_notification_table = notification_table(_source)

API

notification(title, *, description=None, icon=None, tag=None, silent=None, on_click=None, on_close=None)

Argument Type Description
title str The title to display in the notification.
description str Body text to display below the title.
icon str URL of an image to display as the notification's icon.
tag str Notifications sharing a tag replace each other instead of stacking.
silent bool Display without sound or vibration, regardless of device settings.
on_click Callable Called when the user clicks the notification.
on_close Callable Called when the notification is closed, either by the user or after a timeout.

Raises NotificationError if called off the render thread. Returns None — a notification is fire-and-forget, there is no handle to dismiss it from Python.

Examples

Runnable panels live in examples/. They are copied into the Web IDE's notebook list when the dev server is launched — see AGENTS.md.

Contributing

See AGENTS.md for the project layout and the build/run/test/lint loop.

License

Apache-2.0

Metadata

Release files for deephaven-plugin-notification 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deephaven-plugin-notification 0.1.0
File Size Uploaded Provenance
deephaven_plugin_notification-0.1.0.tar.gz 14.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for deephaven-plugin-notification 0.1.0
File Interpreter ABI Platform
deephaven_plugin_notification-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.3 kB

Release files / deephaven_plugin_notification-0.1.0.tar.gz

Download URL deephaven_plugin_notification-0.1.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b6f1fd375b47634b818f3308d63c8381298a126341c997f60aaa015cff774ff5
BLAKE2b-256 checksum
How to use checksums
e78ebdf25ce8ae458f6340db5cfb3575c83d047cd0dc208bb333bb3662b3be17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 26, 2026.

Transparency log

Release files / deephaven_plugin_notification-0.1.0-py3-none-any.whl

Download URL deephaven_plugin_notification-0.1.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d1b36918739c5c47ac66deb1e214ec5d7bfd6c76dbaeb5173c74a3d4186dfc9
BLAKE2b-256 checksum
How to use checksums
74071cc8498d649919fe95997b4a491e7be2a17c615bfa705d1cd5d6663eac9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 26, 2026.

Transparency log

Security for deephaven-plugin-notification 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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for deephaven_plugin_notification-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 Aug 26, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page