Skip to main content

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 universal-notification-service

# With Slack support
pip install universal-notification-service[slack]

# With Email support  
pip install universal-notification-service[email]

# With Discord support
pip install universal-notification-service[discord]

# With all providers
pip install universal-notification-service[all]

Quick Start

import asyncio
from 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yeonjae_universal_notification_service-1.0.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file yeonjae_universal_notification_service-1.0.1.tar.gz.

File metadata

File hashes

Hashes for yeonjae_universal_notification_service-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7c46359ed4563a1f2fdd699046b86f42a8ec8c16994382a53a4163aa1a49071a
MD5 b1c765032252c8f17406c10e75a47a7a
BLAKE2b-256 f493c53e405f1072ecd270fc24c82790c318c396c696a9174145ef92b29356bb

See more details on using hashes here.

File details

Details for the file yeonjae_universal_notification_service-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for yeonjae_universal_notification_service-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 377e8c407e021a6fe13384c88c599afc6507286c3a2827392dc19e8ba7f71cd0
MD5 4fc3080257aa1f4607822d42a1fc3774
BLAKE2b-256 2fc81da3b1bae49725c8ccc27192494dc6ed7c363931bd3df3d09c22f80acacb

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