Tired of constantly checking your jupyter notebook to see if your code has finished executing?
Frustrated by checking your code after waiting hours, only to see your code failed in 5 minutes?
Worry no more! This magic command will notify you via slack when your code finishes or fails!
$ pip install jupyter_slack
Import in your notebook and use like this:
You should receive messages in slack like this:
You can also use the features within your code like this:
import jupyter_slack
jupyter_slack.notify_self("hello world")
Or, if you want notifications when execution fails and/or know how long your command takes, you can use the following context manager:
import jupyter_slack
with jupyter_slack.Monitor("hello world", time=True):
do_something()
-
Create an incoming webhook
-
Set the following environmental variable:
export SLACK_WEBHOOK_URL=your_webhook_url
-
Acquire a Slack api token
-
Set the following variables in your .bashrc (or whatever profile you are using):
$ export SLACK_TOKEN=slack_token
$ export SLACK_ID=username