Notifications multi-canaux : Email, Slack, Telegram, Discord, WhatsApp en une ligne
Project description
notifyall 🔔
Notifications multi-canaux pour Python — zéro dépendance externe. Envoyez vers Email, Slack, Telegram, Discord, WhatsApp, Teams, Pushover et Ntfy en une seule ligne.
⚡ Installation
pip install notifyall
🚀 Utilisation rapide
from notifyall import Notifier
from notifyall.channels import SlackChannel, TelegramChannel, DiscordChannel
n = Notifier(default_title="Mon App")
n.add(SlackChannel(webhook_url="https://hooks.slack.com/..."))
n.add(TelegramChannel(bot_token="123:ABC", chat_id="-100..."))
n.add(DiscordChannel(webhook_url="https://discord.com/api/webhooks/..."))
# Envoi séquentiel
results = n.notify("Déploiement réussi ✅")
# Envoi parallèle (plus rapide)
results = n.notify_parallel("Déploiement réussi ✅")
# Envoi avec template
n.notify_template("🚀 Version {version} déployée sur {env} !", version="2.0", env="prod")
# Envoi conditionnel
n.notify_if(cpu_usage > 90, "⚠️ CPU surchargé !", title="Alerte Serveur")
📦 Canaux supportés
| Canal | Classe | Prérequis | Gratuit |
|---|---|---|---|
| EmailChannel | SMTP credentials | ✅ | |
| Slack | SlackChannel | Webhook URL | ✅ |
| Telegram | TelegramChannel | Bot token + Chat ID | ✅ |
| Discord | DiscordChannel | Webhook URL | ✅ |
| Ntfy | NtfyChannel | Topic (sans compte !) | ✅ |
| WhatsAppChannel | Compte Twilio | 💰 | |
| Teams | TeamsChannel | Webhook URL | ✅ |
| Pushover | PushoverChannel | App token + User key | 💰 |
✨ Fonctionnalités avancées
- 🔄 Retry automatique —
channel.send_with_retry(msg, retries=3) - ⚡ Envoi parallèle —
n.notify_parallel(msg)pour envoyer sur tous les canaux simultanément - 📋 Templates —
n.notify_template("Version {v} !", v="2.0") - ✅ Envoi conditionnel —
n.notify_if(condition, msg) - 📊 Statistiques —
n.stats()retourne le taux de succès - 📜 Historique —
n.historyliste toutes les notifications envoyées - 💬 Discord Embeds —
channel.send_embed(title, description, color, fields) - 📸 Telegram Photos —
channel.send_photo(url, caption) - 📧 Email HTML —
channel.send_html("<h1>Hello</h1>") - 🎨 Slack Block Kit —
channel.send_blocks([...])
🔄 Retry automatique
from notifyall.channels import SlackChannel
ch = SlackChannel(webhook_url="...")
result = ch.send_with_retry("Message important", retries=3, delay=2.0)
📊 Statistiques
n.notify("Hello")
n.notify("World")
print(n.stats())
# {'total_sends': 4, 'success': 4, 'errors': 0, 'success_rate': '100.0%', ...}
✅ Pourquoi notifyall ?
- Zéro dépendance — bibliothèque standard Python uniquement
- 8 canaux — Email, Slack, Telegram, Discord, WhatsApp, Teams, Pushover, Ntfy
- API unifiée — une interface pour tous les services
- Envoi parallèle — tous les canaux simultanément
- Retry intégré — réessais automatiques en cas d'échec
- Historique & stats — suivez vos notifications
📄 Licence
MIT © Votre Nom
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
notifyall-0.2.1.tar.gz
(7.1 kB
view details)
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 notifyall-0.2.1.tar.gz.
File metadata
- Download URL: notifyall-0.2.1.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d3b35c6dcbd5e2a35bf9b66aa813dbd71e7e496b63f8f051545613da748889d
|
|
| MD5 |
474e2178b5ee44df0318df47ce781008
|
|
| BLAKE2b-256 |
e010369860ce18f602140a6af82a34855489ced8892d985bf91f4d66fc4eced2
|
File details
Details for the file notifyall-0.2.1-py3-none-any.whl.
File metadata
- Download URL: notifyall-0.2.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c52a5caecad06f07ac33507855e3ed34805fa02777854826394bdff938749363
|
|
| MD5 |
a9a66c32453973b47e14c71ddb23a028
|
|
| BLAKE2b-256 |
28e27037701d4aef8a0e8ca651a4448eefa8c8a4163cbd5b66d3367c054fe4a0
|