Skip to content
A Jupyter Notebook magic for browser notifications of cell completion
Python Jupyter Notebook JavaScript Makefile
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
jupyternotify ENH added function so that the extension could be loaded normally (#29) Jan 4, 2018
tests Bumped the version, filled out the CHANGELOG, and added a test notebo… Nov 3, 2017
.gitignore Refactor package structure so that pip installation works. Jul 17, 2017
AUTHORS.txt Add Hanna to the AUTHORS. Aug 25, 2017
LICENSE.txt Initial commit. Jun 1, 2017 Properly render the readme using instead of twine. Jul 24, 2017
Makefile Change to license formatting in to make twine work. Jul 24, 2017
README.rst Updateds the README.rst for PyPI. (#31) Jan 8, 2018
requirements.txt Add requirements to setup and fix up some stuff Jul 17, 2017

pypiv pyv License Thanks

ShopRunner logo

A Jupyter Magic For Browser Notifications of Cell Completion

Jupyter notebook notification in Chrome

Jupyter notebook notification in Firefox

This package provides a Jupyter notebook cell magic %%notify that notifies the user upon completion of a potentially long-running cell via a browser push notification. Use cases include long-running machine learning models, grid searches, or Spark computations. This magic allows you to navigate away to other work (or even another Mac desktop entirely) and still get a notification when your cell completes. Clicking on the body of the notification will bring you directly to the browser window and tab with the notebook, even if you're on a different desktop (clicking the "Close" button in the notification will keep you where you are).

Supported browsers

The extension has currently been tested in Chrome (Version: 58.0.3029) and Firefox (Version: 53.0.3).

Note: Firefox also makes an audible bell sound when the notification fires (the sound can be turned off in OS X as described here).

Note for Remote Servers: This extension will work on remote servers as well. However, you'll need to have the jupyter notebook running on https. You can find instructions here.

Import the repo

To use the package, install it via pip directly:

pip install jupyternotify

or add it to the requirements.txt of your repo.

To install directly from source:

git clone
cd jupyter-notify/
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
jupyter notebook


Load inside a Jupyter notebook:

%load_ext jupyternotify

Automatically load in all notebooks

Add the following lines to your ipython startup file:

c.InteractiveShellApp.extensions = [

The .ipython startup file can be generated with ipython profile create [profilename] and will create a configuration file at ~/.ipython/profile_[profilename]/'. Leaving [profilename] blank will create a default profile (see this for more info).

To test the extension, try

import time


NOTE: Currently options cannot be used with %load_ext or the ipython startup file instructions above.

To load the magic with options, you should load it manually by doing the following:

import jupyternotify
ip = get_ipython()

or add this to your ipython startup file:

c.InteractiveShellApp.exec_lines = [
    'import jupyternotify',
    'ip = get_ipython()',
    'ip.register_magics(jupyternotify.JupyterNotifyMagics(ip, option_name="option_value"))'

The following options exist:

  • require_interaction - Boolean, default False. When this is true, notifications will remain on screen until dismissed. This feature is currently only available in Google Chrome.

Custom Message

You may specify what message you wish the notification to display:

%%notify -m "sleep for 5 secs"
import time

Jupyter notebook notification with custom message

Fire notification mid-cell

You may also fire a notification in the middle of a cell using line magic.

import time
%notify -m "slept for 5 seconds."
%notify -m "slept for 6 seconds."

Automatically trigger notification after a certain cell execution time

Using the autonotify line magic, you can have notifications automatically trigger on cell finish if the execution time is longer than some threshold (in seconds) using %autonotify --after <seconds> or %autonotify -a <seconds>.

import numpy as np
import time
# autonotify on completion for cells that run longer than 30 seconds
%autonotify -a 30

Then later...

# no notification
# sends notification on finish

autonotify also takes the arguments --message / -m and --output / -o.

Use cell output as message

You may use the last line of the cell's output as the notification message using --output or -o.

%%notify -o
answer = 42
'The answer is {}.'.format(answer)

Notification message: The answer is 42.

You can’t perform that action at this time.