Push Notifications that work with just about every platform!
npx @tessl/cli install tessl/pypi-apprise@1.9.0A comprehensive Python notification library that provides a unified interface for sending notifications to over 100 different notification services including Telegram, Discord, Slack, Amazon SNS, email providers, SMS services, and many more. Apprise offers both a command-line interface and a developer API with support for configuration files, file attachments, custom notification hooks, and asynchronous message delivery for optimal performance.
pip install appriseimport appriseCommon patterns:
from apprise import Apprise, AppriseConfig, AppriseAttachment
from apprise import NotifyType, NotifyFormat, OverflowModeimport apprise
# Create an Apprise instance
apobj = apprise.Apprise()
# Add notification services using URLs
apobj.add('mailto://user:pass@gmail.com')
apobj.add('slack://TokenA/TokenB/TokenC/Channel')
apobj.add('discord://webhook_id/webhook_token')
# Send a notification
apobj.notify(
body='my notification body',
title='my title',
notify_type=apprise.NotifyType.INFO
)
# Send with attachments
attach = apprise.AppriseAttachment('/path/to/file.jpg')
apobj.notify(
body='Check out this image!',
title='Photo Notification',
attach=attach
)Apprise uses a plugin-based architecture with these core components:
This design enables unified notification management across diverse services while maintaining extensibility and performance optimization.
Primary notification functionality including service management, message sending, and notification orchestration. The main Apprise class provides the foundation for all notification operations.
class Apprise:
def __init__(self, servers=None, asset=None, location=None, debug=False): ...
def add(self, urls, asset=None, tag=None): ...
def notify(self, body, title='', notify_type=NotifyType.INFO, body_format=None, tag=None, match_always=True, attach=None, interpret_escapes=None): ...
def async_notify(self, *args, **kwargs): ...
def clear(self): ...
def find(self, tag=None, match_always=True): ...
def pop(self, index): ...
def details(self, show_requirements=True, show_disabled=False, lang=None): ...
def urls(self, privacy=False): ...
@staticmethod
def instantiate(url, asset=None, tag=None, suppress_exceptions=True): ...Configuration loading and management from files, URLs, and various formats. AppriseConfig enables centralized configuration of notification services.
class AppriseConfig:
def __init__(self, paths=None, asset=None, cache=True, recursion=0, insecure_includes=False, **kwargs): ...
def add(self, configs, asset=None, tag=None, cache=None, recursion=None, insecure_includes=None): ...
def add_config(self, content, asset=None, tag=None, format=None): ...
def servers(self, tag=None): ...
def clear(self): ...
def server_pop(self, index): ...
def pop(self, index): ...
@staticmethod
def instantiate(url, asset=None, tag=None, cache=None): ...File attachment support for notifications including local files, URLs, and various attachment sources with size management and caching.
class AppriseAttachment:
def __init__(self, paths=None, asset=None, cache=True, location=None): ...
def add(self, attachments, asset=None, cache=None): ...
def size(self): ...
def clear(self): ...
def pop(self, index): ...
def sync(self): ...
@staticmethod
def instantiate(url, asset=None, cache=None): ...Asset management for customizable themes, icons, branding, and visual elements used in notifications.
class AppriseAsset:
def __init__(self, **kwargs): ...
def color(self, notify_type, color_type=None): ...
def image_url(self, notify_type, image_size, logo=False, extension=None): ...
def image_path(self, notify_type, image_size, must_exist=True, extension=None): ...
def image_raw(self, notify_type, image_size, must_exist=True, extension=None): ...
def ascii(self, notify_type): ...
def details(self): ...
@staticmethod
def hex_to_rgb(hex_color): ...
@staticmethod
def hex_to_int(hex_color): ...Base classes and managers for notification service plugins, configuration loaders, and attachment handlers. The plugin system enables extensibility and service discovery.
class NotifyBase(URLBase):
def send(self, body, title='', notify_type=NotifyType.INFO, attach=None, **kwargs): ...
def url(self, privacy=False, *args, **kwargs): ...
def throttle(self, last_notification=None): ...
class NotificationManager:
def plugins(self, include_disabled=True): ...
def schemas(self): ...Multi-language support for notification content with locale management and text translation capabilities.
class AppriseLocale:
def __init__(self, language=None): ...
def add(self, lang=None, set_default=True): ...
def lang_at(self, lang, mapto=None): ...
@property
def gettext(self): ...
@staticmethod
def detect_language(lang=None, detect_fallback=True): ...State management and persistent storage for notification services supporting various storage modes and data persistence.
class PersistentStore:
def __init__(self, path=None, namespace='default', mode=None): ...
def read(self, key=None, compress=True, expires=False): ...
def write(self, data, key=None, compress=True): ...
def get(self, key, expires=False): ...
def set(self, key, value, expires=False): ...
def clear(self, *args): ...
def flush(self, key=None, **kwargs): ...
def prune(self): ...
def size(self, **kwargs): ...class NotifyType:
INFO = 'info'
SUCCESS = 'success'
WARNING = 'warning'
FAILURE = 'failure'
NOTIFY_TYPES = [NotifyType.INFO, NotifyType.SUCCESS, NotifyType.WARNING, NotifyType.FAILURE]class NotifyFormat:
TEXT = 'text'
HTML = 'html'
MARKDOWN = 'markdown'
class OverflowMode:
UPSTREAM = 'upstream'
TRUNCATE = 'truncate'
SPLIT = 'split'
class ConfigFormat:
TEXT = 'text'
YAML = 'yaml'class NotifyImageSize:
XY_32 = '32x32'
XY_72 = '72x72'
XY_128 = '128x128'
XY_256 = '256x256'
class ContentLocation:
LOCAL = 'local'
HOSTED = 'hosted'
INACCESSIBLE = 'n/a'
class ContentIncludeMode:
STRICT = 'strict'
ALWAYS = 'always'
NEVER = 'never'class PersistentStoreMode:
AUTO = 'auto'
FLUSH = 'flush'
MEMORY = 'memory'class AppriseException(Exception):
"""Base exception for all Apprise errors"""
class ApprisePluginException(AppriseException):
"""Raised for plugin-specific errors"""
class AppriseDiskIOError(AppriseException):
"""Raised for disk I/O related errors"""
class AppriseInvalidData(AppriseException):
"""Raised when invalid data is encountered"""
class AppriseFileNotFound(AppriseDiskIOError, FileNotFoundError):
"""Raised when a file cannot be found or accessed"""