Apprise: Universal Push Notifications for Nearly Every Platform

Summary
Apprise is a powerful Python library and command-line tool designed to simplify sending push notifications across a vast array of services. It offers a unified API and intuitive syntax, allowing developers and system administrators to integrate notifications with ease. Supporting almost every popular notification platform, Apprise streamlines communication and alerts for various applications.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
Apprise is an incredibly versatile Python library and command-line tool that simplifies sending push notifications to almost every popular notification service available today. With over 14,600 stars and 500 forks on GitHub, Apprise has become a go-to solution for developers and system administrators seeking a unified approach to alerts and communication. It eliminates the need to learn individual APIs for services like Telegram, Discord, Slack, Amazon SNS, Gotify, and many more, providing a common and intuitive syntax for all.
Installation
Getting started with Apprise is straightforward. The easiest method is to install it via PyPI:
pip install apprise
For users on Redhat, CentOS, Rocky, Oracle Linux, and Fedora, Apprise is also available through EPEL:
# Follow instructions on https://docs.fedoraproject.org/en-US/epel
# to get your system connected up to EPEL and then:
# Redhat/CentOS 7.x users
yum install apprise
# Redhat/CentOS 8.x+ and/or Fedora Users
dnf install apprise
If you prefer a graphical interface, consider the Apprise API/Web Interface for centralized configuration and notification management.
Examples
Apprise offers both a powerful command-line interface (CLI) and a flexible Python API.
Command Line Interface (CLI)
Send notifications directly from your terminal:
# Send a notification to multiple services
apprise -vv -t 'My Server Alert' -b 'Disk space is low on /dev/sda1!' \
'mailto://myemail:mypass@gmail.com' \
'pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b'
# Use stdin for the body
cat /var/log/syslog | apprise -vv -t 'Latest Syslog Entries' \
'discord:///webhook_id/webhook_token'
Apprise also supports configuration files (YAML or plain text) to store your notification URLs securely, avoiding credentials on the command line.
# Example using a configuration file
apprise -vv -t 'Daily Report' -b 'See attached for today\'s summary.' \
--config=/path/to/my/config.yml \
--attach=/var/reports/daily.pdf
Python API
Integrate Apprise into your Python applications with ease:
import apprise
# Create an Apprise instance
apobj = apprise.Apprise()
# Add notification services
apobj.add('mailto://myuserid:mypass@gmail.com')
apobj.add('tgram://bottoken/ChatID')
# Send a notification
apobj.notify(
body='Your task has completed successfully!',
title='Process Complete',
)
# Use configuration files with the API
from apprise import AppriseConfig
config = apprise.AppriseConfig()
config.add('https://myserver:8080/path/to/config')
apobj.add(config)
# Send to specific tagged services
apobj.add('slack://TokenA/TokenB/TokenC/Channel', tag='devteam')
apobj.notify(
body='Critical error in production!',
title='Urgent: Production Issue',
tag='devteam',
)
Why Use Apprise
Apprise stands out as a comprehensive notification solution due to several key advantages:
- Unmatched Versatility: It supports an extensive list of notification services, including popular chat platforms, email providers, SMS gateways, desktop notifications, and even custom webhooks (JSON, XML, Form). This "one library to rule them all" approach drastically reduces integration complexity.
- Simplified Integration: With a consistent API and CLI, developers and system administrators can quickly add notification capabilities without needing to learn the specifics of each service.
- Asynchronous Performance: All messages are sent asynchronously, ensuring amazing response times and minimal impact on your application's performance.
- Flexible Configuration: Support for configuration files, environment variables, and tagging allows for secure and organized management of notification endpoints, making it easy to target specific groups or services.
- Rich Features: Beyond basic messages, Apprise handles images and file attachments, offers persistent storage for caching, and allows for the creation of custom notification hooks.
Links
For more detailed information and to explore Apprise further, please visit the official resources: