SlackNotifPy: A Simple Tool for Job Monitoring with Slack

Python
Slack
Open-Source
Job Monitoring

As a developer working with multiple teams on multiple projects, I found that tracking the status of automated jobs and scripts can be a bit of a hassle. Whether you’re running data processing pipelines, handcrafted backup scripts, or training deep learning models, keeping tabs on job completion can be time-consuming. That’s why I started making SlackNotifPy - a Python CLI tool that bridges the gap between your scripts and your team’s communication workflow.

What Does SlackNotifPy Do?

SlackNotifPy is a command-line tool that does one thing: it runs your Python or shell commands and sends a real-time notification to a Slack channel. Features include:

  • Dead Simple Configs: Set up your Slack integration with just a few commands
  • Flexible Execution: Run Python scripts or shell commands
  • Customizable Notifications: Tailor success and failure messages to your needs
  • User Tagging: Easily mention team members in notifications
  • One-Line Configuration and Execution: Send a notification with one command without using the init command (say, from a docker container)

Getting Started

Prerequisites: A new Slack app in your workspace with users:read and chat:write scopes for it’s API token

Installing SlackNotifPy can be done with a simple pip command:

pip install slacknotifpy

Configuration is just as easy. One command walks you through the steps:

slacknotif init

Real-World Use Cases

Here are a few scenarios where SlackNotifPy makes sense:

  1. Data Science Workflows: Get instant notifications when you data processing scripts complete
  2. DevOps Automation: Track the status of deployment or backup scripts
  3. Machine Learning Pipelines: Monitor long-running training jobs

Easy Configs

You can override configuration settings on-the-fly, tag specific team members in notifications, and set custom message templates. You can also send a message without having run the init command if it makes sense for your use-case or you just don’t want to save a (probably) harmless token to disk when configuring the tool.

Get Involved

License

SlackNotifPy is released under the MIT License, so feel free to use, modify, and distribute it 🚀.