Skip to main content

Jupyterlab extension to show notebook cell completion browser notifications

Project description

jupyterlab-notifications

Github Actions Status Binder PyPI npm

Notebook Cell Completion Browser Notifications for JupyterLab.

Image of successful notebook cell execution notification

notification

Image of failed notebook cell execution notification (Available only in >= v0.3.0)

error_notification

Image of last selected notebook cell execution notification (Available only in >= v0.3.0)

Screen Shot 2021-07-31 at 12 49 49 PM

Requirements

  • Web Browser that supports the Notification Web API (See Browser Compatibility Chart)
  • JupyterLab >= 3.0
  • :warning: For versions < 0.3.0, Notebook Cell Timing needs to be enabled for Jupyterlab Notifications to work. Please go to Settings -> Advanced Settings Editor -> Notebook and update setting to:
{
  // Recording timing
  // Should timing data be recorded in cell metadata
  "recordTiming": true
}
  • The cell timing doesn't need to be enabled for Jupyterlab >= 3.1 and Jupyterlab notification version >= v0.3.0.

Install

For JupyterLab 3.x, the extension can be installed with pip:

pip install jupyterlab-notifications

Settings

Use the following settings to update cell execution time for a notification and information to display in the notification. (in Settings > Advanced Settings Editor):

{
    // Notifications
    // jupyterlab-notifications:plugin
    // Settings for the Notifications extension
    // ****************************************

    // Cell Number Type
    // Type of cell number to display when the report_cell_number is true. Select from 'cell_index' or ‘cell_execution_count'.
    "cell_number_type": "cell_index",

    // Enabled Status
    // Enable the extension or not.
    "enabled": true,

    // Trigger only for the last selected notebook cell execution.
    // Trigger a notification only for the last selected executed notebook cell.
    // NOTE: Only Available in version >= v0.3.0
    "last_cell_only": false,

    // Minimum Notebook Cell Execution Time
    // The minimum execution time to send out notification for a particular notebook cell (in seconds).
    "minimum_cell_execution_time": 60,

    // Report Notebook Cell Execution Time
    // Display notebook cell execution time in the notification. 
    // If last_cell_only is set to true, the total duration of the selected cells will be displayed.
    "report_cell_execution_time": true,

    // Report Notebook Cell Number
    // Display notebook cell number in the notification.
    "report_cell_number": true
}

notification

Contributing

Development install

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the jupyterlab-notifications directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jlpm run install:extension
# Rebuild extension Typescript source after making changes
jlpm run build

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

Uninstall

pip uninstall jupyterlab-notifications

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

jupyterlab_notifications-0.3.0-py3-none-any.whl (219.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page