Package: jupyterlab-notifications
jupyterlab-notificationsNotebook Cell Completion Notifications for JupyterLab.Option to get notebook cell completion notifications via browser, slack, mobile, telegram, and many more!Image of successful notebook cell execution browser notificationImage of failed notebook cell execution browser notification(Available only in >= v0.3.0)Image of last selected notebook cell execution browser notification(Available only in >= v0.3.0)Image of mobile phone notifications usingntfy+ PushoverImage of slack notification viantfy + slack_webhookQuick demos and tutorials :notebook:To test out this extension without any local set-up, please check out thebinder link. This will set-up the environment, install the extension, and take you to several demo notebooks for you to play around with to get familiar with the notifications extension.In thetutorialdirectory, there are several example notebooks you can use to test out the notifications extension.Notebooks withpy3_demo_prefix - Minimal Python3 Notebooks to test out the extension.julia_demo.ipynb- Minimal Julia Notebook to test out the extension. :warning: Note: Thetutorial/julia_demo.ipynbwill not work in the binder environment and will require additional set-up to test the Julia Notebook Kernel locally.Compatible Versions and Requirements 🧰jupyterlab-notificationsjupyterlabNotebook Cell Timing EnabledBrowser Requirements>=0.3.0>=3.1.0Not requiredSupports the Notification Web API*<0.3.0>3.0.0RequiredSupports the Notification Web API**For Notification Web API support, please check outBrowser Compatibility Chart)InstallFor JupyterLab 3.x, the extension can be installed withpip:pipinstalljupyterlab-notificationsorconda:condainstall-cconda-forgejupyterlab-notificationsSettingsUse the following settings to update cell execution time for a notification and information to display in the notification. (inSettings > 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,

  // Notification Methods
  // Option to send a notification with the specified method(s). The available options are 'browser' and 'ntfy'.
  notification_methods: ['browser'],

  // 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
}How to enable Notebook Cell Timing: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.(Optional) Notifications usingntfyYou can recieve notifications viantfy.ntfy 2.7.0 documentationhttps://ntfy.readthedocs.io/en/latest/ntfy brings notification to your shell. It can automatically provide desktop notifications when long running code executions finish or it can send push notifications to your phone when a specific execution finishes.How to enable notifications viantfyInstallntfy.$pipinstallntfyYou can find configuration instructions for different operating systems inthe ntfy official configuration docsFor example, if you want to get notifications via thePushover mobile app, make sure to create the configuration file in the right location and selectpushoverfor the backend.$vim~/.config/ntfy/ntfy.yml# Linux$vim~/Library/ApplicationSupport/ntfy/ntfy.yml# macOSNote:You'll need to first install the Pushover mobile app and create an account to generate your user key.backends:-pushoverpushover:user_key:YOUR_PUSHOVER_USER_KEYChange the notificationssettings. Append"ntfy"intonotification_methodsattribute.NOTE: The valuebrowserimplies default conventional method, which uses Webbrowser's Notification API.{
  // ...
  notification_methods: ['browser', 'ntfy']
  // ...
}ContributingDevelopment installNote: You will need NodeJS to build the extension package.Thejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the jupyterlab-notifications directory# Install package in development modepipinstall-e.# Link your development version of the extension with JupyterLabjlpmruninstall:extension# Rebuild extension Typescript source after making changesjlpmrunbuildYou 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 neededjlpmrunwatch# Run JupyterLab in another terminaljupyterlabWith 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).Uninstallpipuninstalljupyterlab-notifications