Skip to main content

Experiment Notifier

Usage

Slack notifications

The experiment notifier assumes that for sending messages you have SLACK_BOT_TOKEN either in:

  • current working directory stored in ./.slack_bot_token file
  • or at your home dir in the file $HOME/.slack_bot_token
  • or in SLACK_BOT_TOKEN variable

Note, that storing the token in a file with 600 permissions is the recommended method.

CLI usage

$ sleep 9999; ntf --channel exp-notifier --text "Done sleeping $? Your long running task just finished!"

Python usage

from notifier.context import SlackMessage

with SlackMessage(channel='exp-notifier') as sm:
  sm.write('test from python')

Installation

  • Setup and install the app
    • Set permissions/scopes to chat:write, identityb:basic,groups:write, im:write
    • Remember SLACK_BOT_TOKEN
  • Setup Socket mode.
    • Remember SLACK_APP_TOKEN
  • Add your app APPNAME e.g. exp-notifier to slack channel #CHANNEL e.g. #exp-notifier
  • Install the client library and the ntf python script pip install exp-notifier

Development

# change to git root directory of source code
pip install -e '.[dev]'

Features

  • Sending text message to a channel under the app name.
  • Sending a text instant message (IM).
  • Attach file (log file) to a message
  • Attach a picture / sound file to be played back
  • Send a text message and mention a person
  • Block code execution, present poll to a user, continue based on the poll answer.

Pull requests are welcome!

Metadata

Release files for exp-notifier 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for exp-notifier 0.0.5
File Size Uploaded
exp-notifier-0.0.5.tar.gz 5.1 kB Details

Release files / exp-notifier-0.0.5.tar.gz

Download URL exp-notifier-0.0.5.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
45240c593a30c9edc2708aa4d0a3229de74947cfd22e45037c65c1ec1b929d90
BLAKE2b-256 checksum
How to use checksums
046bb32038559dbb31e091a0d4988c45bfbfcbf4f491409008b65883c5cd9936
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release history Release notifications | RSS feed

This release

0.0.5 This release

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page