Notification
This module contains classes for sending notifications.
ATTRIBUTE | DESCRIPTION |
---|---|
FILENAME_TIME_FORMAT |
time format for filenames
TYPE:
|
CLASS | DESCRIPTION |
---|---|
Notifier |
class for sending notifications |
EmailNotifier |
class for sending email notifications |
Documentation last updated: 2025-06-11
EmailNotifier
Bases: Notifier
EmailNotifier class for sending email notifications. Use the EmailNotifier class as context manager to handle app passwords securely.
ATTRIBUTE | DESCRIPTION |
---|---|
configs |
configuration details for the notifier
TYPE:
|
METHOD | DESCRIPTION |
---|---|
fromFile |
create a Notifier object from a configuration file |
writeMessage |
write a message |
writeEmail |
write an email message |
notify |
write and send a message through chosen service |
sendMessage |
send a message through chosen service |
sendEmail |
send an email message through chosen server |
sendEmail
Send an email message through chosen server
PARAMETER | DESCRIPTION |
---|---|
service_config
|
configuration details for the service
TYPE:
|
username
|
username for the service
TYPE:
|
message
|
email message to be sent
TYPE:
|
writeEmail
classmethod
writeEmail(
message_config: dict,
placeholders: dict | None = None,
*args,
attachments: Iterable[Path] | None = None,
save_zip: bool = False,
time_format: str = "%Y-%m-%d %H:%M:%S",
**kwargs,
) -> EmailMessage
Write an email message
PARAMETER | DESCRIPTION |
---|---|
message_config
|
configuration details for the message
TYPE:
|
placeholders
|
placeholders for the message
TYPE:
|
attachments
|
filepaths of attachments to be sent
TYPE:
|
save_zip
|
whether to save the attachments as a zip file
TYPE:
|
time_format
|
time format for the message
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
EmailMessage
|
|
Notifier
Notifier class for sending notifications. Use the Notifier class as context manager to handle app passwords securely.
ATTRIBUTE | DESCRIPTION |
---|---|
configs |
configuration details for the notifier
TYPE:
|
METHOD | DESCRIPTION |
---|---|
fromFile |
create a Notifier object from a configuration file |
writeMessage |
write a message |
notify |
write and send a message through chosen service |
sendMessage |
send a message through chosen service |
Initialize Notifier
class
PARAMETER | DESCRIPTION |
---|---|
configs
|
configuration details for the notifier
TYPE:
|
fromFile
classmethod
fromFile(config_file: str | Path) -> Notifier
Create a Notifier
object from a configuration file
PARAMETER | DESCRIPTION |
---|---|
config_file
|
Path to the configuration file
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Notifier
|
Notifier object created from the configuration file
TYPE:
|
notify
Write and send a message through chosen service
PARAMETER | DESCRIPTION |
---|---|
placeholders
|
placeholders for the message
TYPE:
|
sendMessage
Send a message through chosen service
PARAMETER | DESCRIPTION |
---|---|
service_config
|
configuration details for the service
TYPE:
|
username
|
username for the service
TYPE:
|
message
|
message to be sent
TYPE:
|
writeMessage
classmethod
Write a message
PARAMETER | DESCRIPTION |
---|---|
message_config
|
configuration details for the message
TYPE:
|
placeholders
|
placeholders for the message
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Any
|
message to be sent
TYPE:
|