Skip to content

rakibulhaq/shondesh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shondesh

Shondesh Logo PyPI Version Python versions Coverage Status Snyk PyPI - Downloads Downloads License: MIT

"সন্দেশ" (pronounced shôndesh) in Bengali means news, message, or a type of sweet.

Shondesh is a Python package that provides a unified API for sending notifications across multiple channels.

It supports Email, Telegram, Slack, and Webhook channels, allowing you to easily send messages without worrying about the underlying implementation details.

Features

  • Unified API for sending notifications
  • Pluggable channel support (Email, Telegram, Slack, Webhook)
  • Easy configuration and extension

Installation

pip install shondesh

or with Poetry:

poetry add shondesh

Usage

# Slack Example
from shondesh.channels.channel_factory import ChannelFactory

slack_channel = ChannelFactory.create_channel(
    "slack",
    webhook_url="https://hooks.slack.com/services/your/slack/webhook",
    channel="#general"
)
slack_channel.send("Hello from Shondesh!", username="Notifier")

# Telegram Example
telegram_channel = ChannelFactory.create_channel(
    "telegram",
    webhook_url="https://api.telegram.org/bot<token>/sendMessage",
    chat_id="123456789"
)
telegram_channel.send("Hello Telegram user!")

# Webhook Example
webhook_channel = ChannelFactory.create_channel(
    "webhook",
    url="https://example.com/webhook",
    method="POST",
    headers={"Authorization": "Bearer yourtoken"}
)
webhook_channel.send({"event": "deploy", "status": "success"})

# Email Example
email_channel = ChannelFactory.create_channel(
    "email",
    smtp_server="smtp.example.com",
    smtp_port=587,
    username="[email protected]",
    password="yourpassword"
)
email_channel.send(
    "Hello Email user!",
    to="[email protected]",
    subject="Notification from Shondesh"
)

Configuration

Configuration can be provided via environment variables or directly as arguments to channel constructors.

Supported Channels

  • Email
  • Telegram
  • Slack
  • Webhook

Contributing

Contributions are welcome! Please open issues or submit pull requests.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

License

This project is licensed under the MIT License.

Contact

For questions or support, open an issue on GitHub.

About

Send notification via channels

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages