Practical overview
When it fits
Use Knock Knock when a training job runs long enough that you may not be watching its terminal, or when you want a notification if the process crashes.
Who it is for
- Machine-learning researchers who want an alert when a long training run finishes.
- Developers who want to be notified if a training function crashes.
- Teams that want completion or crash notifications delivered through a supported messaging channel.
Documented uses
- Add completion and crash alerts to a Python training function.
- Send a training result along with a notification when the function returns a value.
- Wrap a command-line process for notification using the documented CLI.
Requirements & limits
The project is an open-source Python library under the MIT license. The README documents installation with pip and says the code has only been tested with Python 3.6 or later.
- Slack setup requires a room webhook URL; Telegram setup requires a bot token and chat ID.
- Email notifications use Yagmail with Gmail/SMTP, and the README describes configuring account access.
- The README lists twelve notification options, including messaging services, email, SMS and desktop notifications.
- The library notifies around the wrapped function's completion or crash; it is not described as a training dashboard.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Add a Slack alert to a training function
Wrap a Python training function so Knock Knock can notify a Slack channel when it completes or crashes.
Before you start
- Python 3.6 or later, as described in the README.
- Install Knock Knock with pip.
- A Slack room webhook URL; a channel name is shown in the example.
Steps
Install the library with the command below.
pip install knockknockImport
slack_senderfromknockknockand set the Slack webhook URL.Apply
@slack_sender(webhook_url=webhook_url, channel="")above the training function.
Expected outcome
The wrapped function is configured to send a Slack notification on completion or a crash; its return value is also reported when present.
Guide limitations
- The setup requires a Slack webhook URL. User mentions are optional and require Slack user IDs.
- The README says the code has only been tested with Python 3.6 or later.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 15 October 2026
- Original website title
- huggingface/knockknock · Official homepage title · retained in its source language

