Skip to main content

Notifications multi-canaux : Email, Slack, Telegram, Discord, WhatsApp en une ligne

Project description

notifyall 🔔

PyPI version Downloads Python 3.9+ License: MIT

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
Email EmailChannel SMTP credentials
Slack SlackChannel Webhook URL
Telegram TelegramChannel Bot token + Chat ID
Discord DiscordChannel Webhook URL
Ntfy NtfyChannel Topic (sans compte !)
WhatsApp WhatsAppChannel Compte Twilio 💰
Teams TeamsChannel Webhook URL
Pushover PushoverChannel App token + User key 💰

✨ Fonctionnalités avancées

  • 🔄 Retry automatiquechannel.send_with_retry(msg, retries=3)
  • ⚡ Envoi parallèlen.notify_parallel(msg) pour envoyer sur tous les canaux simultanément
  • 📋 Templatesn.notify_template("Version {v} !", v="2.0")
  • ✅ Envoi conditionneln.notify_if(condition, msg)
  • 📊 Statistiquesn.stats() retourne le taux de succès
  • 📜 Historiquen.history liste toutes les notifications envoyées
  • 💬 Discord Embedschannel.send_embed(title, description, color, fields)
  • 📸 Telegram Photoschannel.send_photo(url, caption)
  • 📧 Email HTMLchannel.send_html("<h1>Hello</h1>")
  • 🎨 Slack Block Kitchannel.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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notifyall-0.2.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

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

Hashes for notifyall-0.2.1.tar.gz
Algorithm Hash digest
SHA256 1d3b35c6dcbd5e2a35bf9b66aa813dbd71e7e496b63f8f051545613da748889d
MD5 474e2178b5ee44df0318df47ce781008
BLAKE2b-256 e010369860ce18f602140a6af82a34855489ced8892d985bf91f4d66fc4eced2

See more details on using hashes here.

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

Hashes for notifyall-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c52a5caecad06f07ac33507855e3ed34805fa02777854826394bdff938749363
MD5 a9a66c32453973b47e14c71ddb23a028
BLAKE2b-256 28e27037701d4aef8a0e8ca651a4448eefa8c8a4163cbd5b66d3367c054fe4a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page