Universal notification service supporting Slack, Email, Discord, and webhooks for automated reporting
Project description
Universal Notification Service
Universal notification service supporting Slack, Email, Discord, and webhooks for automated reporting.
Features
- Multi-Channel Support: Slack, Email, Discord, Webhooks, SMS
- Async Operations: Full async/await support for all notification operations
- Rich Formatting: Support for emoji, markdown, and channel-specific formatting
- Batch Processing: Send notifications to multiple recipients efficiently
- Retry Logic: Intelligent retry mechanisms with exponential backoff
- Template System: Customizable message templates with variable substitution
- Rate Limiting: Built-in rate limiting for API compliance
- Type Safety: Complete type annotations with mypy support
Installation
# Basic installation
pip install yeonjae-universal-notification-service
# With Slack support
pip install yeonjae-universal-notification-service[slack]
# With Email support
pip install yeonjae-universal-notification-service[email]
# With Discord support
pip install yeonjae-universal-notification-service[discord]
# With all providers
pip install yeonjae-universal-notification-service[all]
Quick Start
import asyncio
from yeonjae_universal_notification_service import (
NotificationService, NotificationInput, NotificationChannel,
NotificationConfig, RecipientInfo
)
async def main():
# Initialize service
service = NotificationService()
# Configure notification
config = NotificationConfig(
channel=NotificationChannel.SLACK,
channel_id="#dev-reports"
)
recipient = RecipientInfo(
developer="John Doe",
developer_email="john@example.com",
slack_id="U1234567890"
)
# Create notification
notification = NotificationInput(
summary_report="🎉 Daily development summary ready!",
notification_config=config,
recipient_info=recipient
)
# Send notification
result = await service.send_notification(notification)
print(f"Status: {result.send_status}")
print(f"Message ID: {result.message_id}")
asyncio.run(main())
Configuration
Set your API keys as environment variables:
export SLACK_BOT_TOKEN="xoxb-your-slack-bot-token"
export DISCORD_BOT_TOKEN="your-discord-bot-token"
export SMTP_PASSWORD="your-email-password"
Supported Channels
- Slack: Rich formatting, mentions, threads, file uploads
- Email: HTML/Plain text, attachments, templates
- Discord: Embeds, mentions, webhooks
- Webhooks: Custom HTTP endpoints with retry logic
- SMS: Text messages via various providers
License
MIT License
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
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 yeonjae_universal_notification_service-1.0.5.tar.gz.
File metadata
- Download URL: yeonjae_universal_notification_service-1.0.5.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f4045bbbca758fa90a9f7614808108faa24a3b3ce0dfe9e288cc51d92fda079
|
|
| MD5 |
e568da3ef3d1f978c7310d4cc460eab5
|
|
| BLAKE2b-256 |
b9fd2d805a20f3d1197940e1339d7aa18a185ee0440c7d8222d101a1d7599988
|
File details
Details for the file yeonjae_universal_notification_service-1.0.5-py3-none-any.whl.
File metadata
- Download URL: yeonjae_universal_notification_service-1.0.5-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b16cdabb45caddc5574b5accc246e47b01ba383e07dca8c26c150feaec44016
|
|
| MD5 |
570309bb7120da916ed4b42227380bf4
|
|
| BLAKE2b-256 |
4e4c25ce673e5c4a7ba77a2a1089ba25a25c8dba314d35f37781a78b2a137b09
|