All Projects → ShopRunner → Jupyter Notify

ShopRunner / Jupyter Notify

Licence: bsd-3-clause
A Jupyter Notebook magic for browser notifications of cell completion

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Jupyter Notify

docker-ocaml-jupyter-datascience
Dockerfiles for data science in OCaml on Jupyter
Stars: ✭ 38 (-92.49%)
Mutual labels:  datascience
Introduction Datascience Python Book
Introduction to Data Science: A Python Approach to Concepts, Techniques and Applications
Stars: ✭ 275 (-45.65%)
Mutual labels:  datascience
Dataframe Js
A javascript library providing a new data structure for datascientists and developpers
Stars: ✭ 376 (-25.69%)
Mutual labels:  datascience
python
Python codes from tutorials on the Data Professor YouTube channel
Stars: ✭ 51 (-89.92%)
Mutual labels:  datascience
Around Dataengineering
A Data Engineering & Machine Learning Knowledge Hub
Stars: ✭ 257 (-49.21%)
Mutual labels:  datascience
Oie Resources
A curated list of Open Information Extraction (OIE) resources: papers, code, data, etc.
Stars: ✭ 283 (-44.07%)
Mutual labels:  datascience
neptune-examples
Examples of using Neptune to keep track of your experiments (maintenance only).
Stars: ✭ 22 (-95.65%)
Mutual labels:  datascience
Socios Brasil
Captura os dados de sócios das empresas brasileiras na Receita Federal e exporta para um formato legível por humanos
Stars: ✭ 445 (-12.06%)
Mutual labels:  datascience
Notebooks Statistics And Machinelearning
Jupyter Notebooks from the old UnsupervisedLearning.com (RIP) machine learning and statistics blog
Stars: ✭ 270 (-46.64%)
Mutual labels:  datascience
For Data Science Beginners
Set of 📝 with 🔗 to help those who are Data Science beginners 🤖
Stars: ✭ 355 (-29.84%)
Mutual labels:  datascience
autonomio
Core functionality for the Autonomio augmented intelligence workbench.
Stars: ✭ 27 (-94.66%)
Mutual labels:  datascience
140stories
140Stories: Collaborative stories 140 chars at a time.
Stars: ✭ 14 (-97.23%)
Mutual labels:  datascience
Code
Compilation of R and Python programming codes on the Data Professor YouTube channel.
Stars: ✭ 287 (-43.28%)
Mutual labels:  datascience
streamlit-geospatial
A multi-page streamlit app for geospatial
Stars: ✭ 310 (-38.74%)
Mutual labels:  datascience
Krangl
krangl is a {K}otlin DSL for data w{rangl}ing
Stars: ✭ 430 (-15.02%)
Mutual labels:  datascience
ODSC India 2018
My presentation at ODSC India 2018 about Deep Learning with Apache Spark
Stars: ✭ 26 (-94.86%)
Mutual labels:  datascience
Dgfraud
A Deep Graph-based Toolbox for Fraud Detection
Stars: ✭ 281 (-44.47%)
Mutual labels:  datascience
Or Pandas
【运筹OR帷幄|数据科学】pandas教程系列电子书
Stars: ✭ 492 (-2.77%)
Mutual labels:  datascience
Metaflow
🚀 Build and manage real-life data science projects with ease!
Stars: ✭ 5,108 (+909.49%)
Mutual labels:  datascience
Mimesis
Mimesis is a high-performance fake data generator for Python, which provides data for a variety of purposes in a variety of languages.
Stars: ✭ 3,439 (+579.64%)
Mutual labels:  datascience

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 [email protected]:ShopRunner/jupyter-notify.git
cd jupyter-notify/
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
jupyter notebook

Usage

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 = [
    'jupyternotify'
]

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

To test the extension, try

%%notify
import time
time.sleep(5)

Options

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()
ip.register_magics(jupyternotify.JupyterNotifyMagics(
    ip,
    option_name="option_value"
))

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
time.sleep(5)
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
time.sleep(5)
%notify -m "slept for 5 seconds."
time.sleep(6)
%notify -m "slept for 6 seconds."
time.sleep(2)

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
time.sleep(29)
# sends notification on finish
time.sleep(31)

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].