Skip to content

whos_there.senders

source package whos_there.senders

Classes

source class DebugSender()

Bases : Sender

Initialize the Debug sender.

Uses the Python logger. Performs logging on rank zero only in a distributed mode.

Parameters

  • print : bool If enabled, outputs using the print command in addition. Defaults to False.. Defaults to False.

Methods

source method DebugSender.send(text: str)Any

source class DiscordSender()

Bases : Sender

Initialize the Discord sender.

Parameters

  • webhook_url : str The Discord webhook URL.

Methods

source method DiscordSender.send(text: str)Any

source class EmailSender(port: int, sender_email: str, password: str, recipient_emails: list[str])

Bases : Sender

Initialize the Email sender.

Parameters

  • host : str The SMTP host.

  • port : int The SMTP port.

  • sender_email : str The senders email adress.

  • password : str The email password.

  • recipient_emails : list[str] The recipients emails.

Attributes

  • server : smtplib.SMTP SMTP server instance.

Methods

source property EmailSender.server: smtplib.SMTP

SMTP server instance.

Returns

  • smtplib.SMTP The SMTP instance.

source method EmailSender.send(text: str)Any

source class SlackSender(channel: str, user_mentions: list[str] | None = None, sender_username: str = 'Kock Knock', icon_emoji: str = '🔔')

Bases : Sender

Initialize the Slack sender.

Parameters

  • webhook_url : str The Slack webhook URL.

  • channel : str The Slack channel name.

  • sender_username : str User name used for notifications.

  • user_mentions : list[str] | None The list of users to mention.

  • icon_emoji : str Emoji to use for the notifications. See for options.

Methods

source method SlackSender.send(text: str)Any

source class TeamsSender(user_mentions: list[str] | None = None)

Bases : Sender

Initialize the Teams sender.

Parameters

  • webhook_url : str The Teams webhook URL.

  • user_mentions : list[str] | None The list of users to mention.

Methods

source method TeamsSender.send(text: str)Any

source class TelegramSender(chat_id: int)

Bases : Sender

Initialize the Telegram sender.

Parameters

  • token : str The Telegram token.

  • chat_id : int The Telegram chat id.

Methods

source property TelegramSender.bot: Bot

source method TelegramSender.send(text: str)Any