Apprise Python (Core) Library
Ce contenu n’est pas encore disponible dans votre langue.
The Apprise library allows you to send notifications to almost all of the most popular notification services available today (Telegram, Discord, Slack, Email, etc.) using a single, unified Python API.
Installation
Section titled “Installation”Apprise is available on PyPI and can be installed via pip.
pip install appriseHello World
Section titled “Hello World”The core of the library is the Apprise object. You instantiate it, add URLs, and trigger notifications.
import apprise
# 1. Instantiate the Apprise Objectapobj = apprise.Apprise()
# 2. Add one or more service URLsapobj.add('mailto://myuser:mypass@hotmail.com')apobj.add('tgram://123456789:ABCDefghIJKLmnOPqrstUVwxyz')
# 3. Send a notification to all added servicesapobj.notify( body='What a great notification service!', title='My Notification Title',)Why use the Library?
Section titled “Why use the Library?”- Unified Syntax: One URL format for services.
- Asynchronous: Sending notifications is non-blocking (optional).
- Tagging: Group services (e.g.,
devops,billing) and notify them selectively. - Attachments: Send files and images effortlessly.
- Rich Text: Support Emojis and handle HTML, TEXT, and Markdown
- Configuration: Load URLs from YAML/Text files or API endpoints.