Multi-backend notification system for SciTeX
Project description
SciTeX Notification (scitex-notification)
Multi-backend notification system for scientific workflows
Full Documentation · pip install scitex-notification
Problem
You delegate a task to an AI coding agent — or kick off a build, training run, deploy — and then you wait. You stare at the terminal, or you context-switch to something else and forget to check back. Either way, you lose: polling kills focus, and forgetting wastes hours.
The same problem scales across every long-running process: CI/CD pipelines, HPC jobs, data migrations, batch processing. There is no standard way to route "I'm done" across the channels developers actually use — TTS, phone calls, SMS, Slack, email.
Solution
SciTeX Notification provides a unified alert interface across 8 backends with a single function call. It speaks, calls, texts, and pings — so you never miss a completion or failure.
| Backend | API | Transport | Cost | Internet | Notes |
|---|---|---|---|---|---|
| Audio | alert() |
TTS to local speakers | Free | No | Via scitex-audio; SSH relay supported |
| Desktop | alert() |
notify-send / PowerShell |
Free | No | Linux / WSL |
| Emacs | alert() |
emacsclient message |
Free | No | Popup, minibuffer, or alert |
| Matplotlib | alert() |
Visual popup window | Free | No | |
| Playwright | alert() |
Browser popup | Free | No | |
alert() |
SMTP | Free | Required | Gmail, SMTP relay | |
| Webhook | alert() |
HTTP POST | Free | Required | Slack, Discord, custom endpoints |
| Twilio | call() sms() |
Phone call / SMS | Paid | Required | No SDK — stdlib urllib only |
alert() tries backends in fallback order until one succeeds. call() and sms() target Twilio directly.
Auditory Feedback -> Phone Call Escalation
When an AI agent needs your attention — even while you sleep — it can escalate from audio to phone call.
Fig. 1: Left — Claude Code terminal showing audio → phone call escalation after 7 consecutive auditory feedback but without no response from user. Right — iPhone receiving repeated "SciTeX Alert" calls from the AI agent.
Penetrating iPhone Silent Mode:
- Emergency Bypass (most reliable): Save your Twilio number as a contact → Ringtone → enable Emergency Bypass. All calls ring regardless of Focus/Silent mode.
- Repeated Calls (fallback): iOS allows the second call from the same number within 3 minutes to ring through.
repeat=2triggers this automatically with a 30-second gap.
Example: /speak-and-continue Command in Claude Code
The /speak-and-continue command is a real-world example of scitex-notification in action. It configures an AI coding agent (Claude Code) to:
- Provide TTS feedback via
audio_speakMCP tool while working autonomously - Repeat the same audio message when the user sends
/speak-and-continueagain (they may be away) - Count consecutive speaks without user response (spoke counter)
- Escalate to phone call after 7 unanswered speaks — waking the user if asleep
This enables a 24/7 development workflow: the agent works autonomously, speaks progress aloud, and calls your phone when it needs your attention or when all tasks are complete.
Installation
Requires Python >= 3.10.
pip install scitex-notification
Install with optional backends:
pip install "scitex-notification[audio]" # audio alerts via scitex-audio
pip install "scitex-notification[twilio]" # SMS via Twilio
pip install "scitex-notification[mcp]" # MCP server for AI agents
pip install "scitex-notification[all]" # everything
SciTeX users:
pip install scitexalready includes Notification. Alerts are automatic via@scitex.session.
Quickstart
import scitex_notification as notification
# Alert via default backend (audio → emacs → email fallback)
notification.alert("Training complete. Val loss: 0.042")
# Alert via a specific backend
notification.alert("Job finished", backend="email")
# Alert via multiple backends
notification.alert("Critical failure", backend=["sms", "email"])
# Make a phone call via Twilio
notification.call("Critical alert!", repeat=2, # Calls twice to bypass silent mode)
# Send an SMS via Twilio
notification.sms("Build done!")
Configure backends via environment variables (see .env.example):
export SCITEX_NOTIFY_DEFAULT_BACKEND=audio
export SCITEX_NOTIFY_TWILIO_SID=ACxxxxxxx
export SCITEX_NOTIFY_TWILIO_TOKEN=...
export SCITEX_NOTIFY_TWILIO_TO=+XX-XXX-XXX-XXXX
Three Interfaces
Python API
import scitex_notification as notification
notification.alert("Job done") # default backend (with fallback)
notification.alert("Error", backend="email") # specific backend
notification.alert("Critical", backend=["sms", "email"]) # multiple backends
notification.call("Urgent!") # phone call via Twilio
notification.sms("Build done!") # SMS via Twilio
notification.available_backends() # list installed backends
CLI Commands
scitex-notification --help # Show all commands
scitex-notification send "Job done" # Send via default backend
scitex-notification send "Done" --backend email # Send via specific backend
scitex-notification config # Show configuration
scitex-notification backends # List available backends
scitex-notification mcp list-tools # List MCP tools
MCP Server — for AI Agents
AI agents can send notifications and check system status autonomously.
| Tool | Description |
|---|---|
notify_handler |
Send an alert via specified or fallback backends |
notify_by_level_handler |
Send alert using level-based backend config |
list_backends_handler |
List all backends with availability status |
get_config_handler |
Show current notification configuration |
scitex-notification mcp start
Add .mcp.json to your project root. Use SCITEX_NOTIFICATION_ENV_SRC to load all configuration from a .src file — this keeps .mcp.json static across environments:
{
"mcpServers": {
"scitex-notification": {
"command": "scitex-notification",
"args": ["mcp", "start"],
"env": {
"SCITEX_NOTIFICATION_ENV_SRC": "${SCITEX_NOTIFICATION_ENV_SRC}"
}
}
}
}
Centralize Speakers by SSH Audio Relay
Running jobs on a remote server or NAS? TTS alerts are relayed back through your SSH tunnel to the speakers on your desk — your remote code speaks through your local machine.
# On your local machine (has speakers)
scitex-audio relay start
# In your SSH config (~/.ssh/config)
Host myserver
RemoteForward 31293 127.0.0.1:31293
# On the remote server — audio plays on your local speakers
notify.alert("Training complete. Val loss: 0.042")
No extra configuration on the notification side. The scitex-audio relay handles the routing automatically.
pip install "scitex-notification[audio]"
Part of SciTeX
SciTeX Notification is part of SciTeX.
The SciTeX system follows the Four Freedoms for Research below, inspired by the Free Software Definition:
Four Freedoms for Research
- The freedom to run your research anywhere — your machine, your terms.
- The freedom to study how every step works — from raw data to final manuscript.
- The freedom to redistribute your workflows, not just your papers.
- The freedom to modify any module and share improvements with the community.
AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scitex_notification-0.1.1.tar.gz.
File metadata
- Download URL: scitex_notification-0.1.1.tar.gz
- Upload date:
- Size: 44.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f20cc797f18aaeca8b8796503a4b1562b65863020cb5d2a444ae059f185a9ca
|
|
| MD5 |
bdacb5c762beb1b514df570358b96674
|
|
| BLAKE2b-256 |
8d09bfd698880c270a169ccefb1e648e131836272d4729f2a41003a3e51c587a
|
Provenance
The following attestation bundles were made for scitex_notification-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-notification
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_notification-0.1.1.tar.gz -
Subject digest:
8f20cc797f18aaeca8b8796503a4b1562b65863020cb5d2a444ae059f185a9ca - Sigstore transparency entry: 1108411930
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-notification@6459ae32d6f8fcab312cce5858768dcc333011c9 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@6459ae32d6f8fcab312cce5858768dcc333011c9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scitex_notification-0.1.1-py3-none-any.whl.
File metadata
- Download URL: scitex_notification-0.1.1-py3-none-any.whl
- Upload date:
- Size: 42.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88c342067fa86e93b325735bbeabec1a938e4d6dd2273eee48ac985176497756
|
|
| MD5 |
0b52fca7238b8fc9db9746309807e94c
|
|
| BLAKE2b-256 |
32e4a272ff921a9c03d9b7c9394bd338b227bd2bf605d63dc93bc2a342cfea11
|
Provenance
The following attestation bundles were made for scitex_notification-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-notification
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_notification-0.1.1-py3-none-any.whl -
Subject digest:
88c342067fa86e93b325735bbeabec1a938e4d6dd2273eee48ac985176497756 - Sigstore transparency entry: 1108411936
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-notification@6459ae32d6f8fcab312cce5858768dcc333011c9 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@6459ae32d6f8fcab312cce5858768dcc333011c9 -
Trigger Event:
push
-
Statement type: