Backends API

Notification backend registry and utilities.

class scitex_notification._backends.AudioBackend(backend: str = 'gtts', speed: float = 1.5, rate: int = 180)[source]

Bases: BaseNotifyBackend

Audio notification via scitex_audio TTS.

is_available() bool[source]

Check if this backend is available.

name: str = 'audio'
async send(message: str, title: str | None = None, level: NotifyLevel = NotifyLevel.INFO, **kwargs) NotifyResult[source]

Send a notification.

class scitex_notification._backends.BaseNotifyBackend[source]

Bases: ABC

Base class for notification backends.

abstractmethod is_available() bool[source]

Check if this backend is available.

name: str = 'base'
abstractmethod async send(message: str, title: str | None = None, level: NotifyLevel = NotifyLevel.INFO, **kwargs) NotifyResult[source]

Send a notification.

class scitex_notification._backends.DesktopBackend[source]

Bases: BaseNotifyBackend

Desktop notification via native OS APIs.

Supports: - Linux: notify-send - WSL/Windows: PowerShell toast notifications

is_available() bool[source]

Check if this backend is available.

name: str = 'desktop'
async send(message: str, title: str | None = None, level: NotifyLevel = NotifyLevel.INFO, **kwargs) NotifyResult[source]

Send a notification.

class scitex_notification._backends.EmacsBackend(method: str = 'popup', timeout: float = 5.0)[source]

Bases: BaseNotifyBackend

Notification via Emacs using emacsclient.

Displays notifications in Emacs minibuffer or as alerts. Supports different display methods: - popup: temporary popup buffer (default, most noticeable) - minibuffer: message function - alert: alert.el package - notifications: notifications.el (desktop notifications from Emacs)

__init__(method: str = 'popup', timeout: float = 5.0)[source]

Initialize Emacs backend.

Parameters:
  • method (str) – Notification method: ‘popup’, ‘minibuffer’, ‘alert’, or ‘notifications’

  • timeout (float) – Display timeout for visual methods

is_available() bool[source]

Check if emacsclient is available.

name: str = 'emacs'
async send(message: str, title: str | None = None, level: NotifyLevel = NotifyLevel.INFO, **kwargs) NotifyResult[source]

Send notification via Emacs.

class scitex_notification._backends.EmailBackend(recipient: str | None = None, sender: str | None = None)[source]

Bases: BaseNotifyBackend

Email notification via SMTP (stdlib smtplib).

is_available() bool[source]

Check if this backend is available.

name: str = 'email'
async send(message: str, title: str | None = None, level: NotifyLevel = NotifyLevel.INFO, **kwargs) NotifyResult[source]

Send a notification.

class scitex_notification._backends.MatplotlibBackend(timeout: float = 5.0)[source]

Bases: BaseNotifyBackend

Visual notification via matplotlib popup window.

is_available() bool[source]

Check if this backend is available.

name: str = 'matplotlib'
async send(message: str, title: str | None = None, level: NotifyLevel = NotifyLevel.INFO, **kwargs) NotifyResult[source]

Send a notification.

class scitex_notification._backends.NotifyLevel(value)[source]

Bases: Enum

Notification urgency levels.

CRITICAL = 'critical'
ERROR = 'error'
INFO = 'info'
WARNING = 'warning'
class scitex_notification._backends.NotifyResult(success: bool, backend: str, message: str, timestamp: str, error: str | None = None, details: dict | None = None)[source]

Bases: object

Result of a notification attempt.

backend: str
details: dict | None = None
error: str | None = None
message: str
success: bool
timestamp: str
class scitex_notification._backends.PlaywrightBackend(timeout: float = 5.0)[source]

Bases: BaseNotifyBackend

Browser notification via Playwright.

is_available() bool[source]

Check if this backend is available.

name: str = 'playwright'
async send(message: str, title: str | None = None, level: NotifyLevel = NotifyLevel.INFO, **kwargs) NotifyResult[source]

Send a notification.

class scitex_notification._backends.TelegramBackend(bot_token: str | None = None, chat_id: str | None = None)[source]

Bases: BaseNotifyBackend

Telegram message notification backend.

is_available() bool[source]

Check if this backend is available.

name: str = 'telegram'
async send(message: str, title: str | None = None, level: NotifyLevel = NotifyLevel.INFO, **kwargs) NotifyResult[source]

Send a notification.

class scitex_notification._backends.TwilioBackend(account_sid: str | None = None, auth_token: str | None = None, from_number: str | None = None, to_number: str | None = None, flow_sid: str | None = None, repeat: int = 1)[source]

Bases: BaseNotifyBackend

Phone call notification via Twilio.

is_available() bool[source]

Check if this backend is available.

name: str = 'twilio'
async send(message: str, title: str | None = None, level: NotifyLevel = NotifyLevel.INFO, **kwargs) NotifyResult[source]

Send a notification.

class scitex_notification._backends.WebhookBackend(url: str | None = None)[source]

Bases: BaseNotifyBackend

Webhook notification for Slack, Discord, etc.

is_available() bool[source]

Check if this backend is available.

name: str = 'webhook'
async send(message: str, title: str | None = None, level: NotifyLevel = NotifyLevel.INFO, **kwargs) NotifyResult[source]

Send a notification.

scitex_notification._backends.available_backends() list[str][source]

Return list of available notification backends.

scitex_notification._backends.get_backend(name: str, **kwargs) BaseNotifyBackend[source]

Get a notification backend by name.