Metadata-Version: 2.4
Name: notifyall
Version: 0.2.1
Summary: Notifications multi-canaux : Email, Slack, Telegram, Discord, WhatsApp en une ligne
License-Expression: MIT
Project-URL: Homepage, https://github.com/votre-pseudo/notifyall
Project-URL: Issues, https://github.com/votre-pseudo/notifyall/issues
Keywords: notification,slack,telegram,discord,whatsapp,email,alert
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Communications
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"

# notifyall 🔔

[![PyPI version](https://badge.fury.io/py/notifyall.svg)](https://pypi.org/project/notifyall/)
[![Downloads](https://static.pepy.tech/badge/notifyall)](https://pepy.tech/project/notifyall)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/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

```bash
pip install notifyall
```

## 🚀 Utilisation rapide

```python
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 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.history` liste 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

```python
from notifyall.channels import SlackChannel

ch = SlackChannel(webhook_url="...")
result = ch.send_with_retry("Message important", retries=3, delay=2.0)
```

## 📊 Statistiques

```python
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](https://github.com/votre-pseudo)
