{"id":1333,"library":"apprise","title":"Apprise: Universal Push Notifications","description":"Apprise is a Python library that provides a common, simple interface for sending push notifications to almost any platform. It supports a vast array of services, including Slack, Discord, email, SMS, Telegram, and many more, allowing developers to integrate notifications without platform-specific code. It maintains an active development pace with several releases per year, continuously adding new services and improving existing ones. The current version is 1.9.9.","status":"active","version":"1.9.9","language":"en","source_language":"en","source_url":"https://github.com/caronc/apprise","tags":["notifications","alerts","messaging","integrations","email","sms","chat"],"install":[{"cmd":"pip install apprise","lang":"bash","label":"Base installation"},{"cmd":"pip install 'apprise[all]'","lang":"bash","label":"With all optional dependencies for all services"}],"dependencies":[{"reason":"Core dependency for HTTP communication with notification services.","package":"requests"},{"reason":"Optional: For HTML parsing capabilities.","package":"lxml","optional":true},{"reason":"Optional: For Markdown rendering.","package":"markdown","optional":true},{"reason":"Optional: For converting HTML to plain text.","package":"html2text","optional":true},{"reason":"Optional: For image resizing and manipulation, used by some services.","package":"pillow","optional":true},{"reason":"Optional: For loading Apprise configuration from YAML files.","package":"pyyaml","optional":true}],"imports":[{"note":"While 'import apprise' works, importing Apprise directly is idiomatic and clearer.","wrong":"import apprise; apobj = apprise.Apprise()","symbol":"Apprise","correct":"from apprise import Apprise"},{"symbol":"AppriseAsset","correct":"from apprise import AppriseAsset"}],"quickstart":{"code":"import apprise\nimport os\n\n# Create an Apprise instance\napobj = apprise.Apprise()\n\n# Add a service URL.\n# Use a real service URL or a dummy one like 'pypi://' for stdout output.\n# Example for Slack: 'slack://tokenA/tokenB/tokenC'\n# Example for Telegram: 'tgram://bottoken/chatid'\n# Replace with your actual URL. Using os.environ.get for security.\nslack_url = os.environ.get('APPRISE_SLACK_URL', 'pypi://')\napobj.add(slack_url)\n\n# Send a notification\napobj.notify(\n    body='Hello from Apprise!',\n    title='Apprise Quickstart',\n    notify_type='info' # info, success, warning, failure\n)\n\nprint(f\"Notification sent (or printed to stdout if using pypi://): {slack_url}\")\n\n# Example with a file attachment (requires AppriseAsset and a valid service)\n# from apprise import AppriseAsset\n# try:\n#    with open('example.txt', 'w') as f:\n#        f.write('This is an example attachment.')\n#    apobj.add('mailto://user@example.com') # Example service supporting attachments\n#    apobj.notify(\n#        body='Message with an attachment.',\n#        attach=AppriseAsset('example.txt')\n#    )\n# except IOError: # mailto will silently fail without a server\n#    print(\"Could not create example.txt or send attachment.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize Apprise, add a notification service URL, and send a basic notification. It also shows how to include a dummy URL for testing output to stdout. For real services, replace `APPRISE_SLACK_URL` with your actual service URL, retrieved from environment variables for security. Remember to install extra dependencies if your chosen service requires them."},"warnings":[{"fix":"Ensure your environment uses Python 3.9 or newer. Review your code for any reliance on internal APIs or behaviors that might have changed during the refactor.","message":"Version 1.9.4 introduced a major code refactor for Python 3.9+ compatibility. While efforts were made to maintain backward compatibility, users running older Python versions (pre-3.9) might experience unexpected behavior or require adjustments to their code.","severity":"breaking","affected_versions":">=1.9.4"},{"fix":"Install Apprise with the specific extras needed for your services (e.g., `pip install 'apprise[slack,telegram]'`) or install all optional dependencies with `pip install 'apprise[all]'`.","message":"Many notification services have specific optional dependencies that are not installed by default with `pip install apprise`. Forgetting to install these can lead to runtime `ImportError` exceptions when trying to use certain services.","severity":"gotcha","affected_versions":"All"},{"fix":"Always refer to the official Apprise documentation (AppriseIt.com) for the correct URL syntax and required parameters for each service. Utilize environment variables or a secure configuration management system for sensitive credentials.","message":"Notification service URLs are critical for Apprise functionality. Incorrectly formatted URLs, missing authentication tokens, or invalid endpoints are common sources of errors that can prevent notifications from being sent.","severity":"gotcha","affected_versions":"All"},{"fix":"Initialize `Apprise` once, typically at application startup, and reuse the `apobj` instance for all subsequent notifications. Call `apobj.add()` for each unique service URL.","message":"The `Apprise` object is designed to be initialized once and reused throughout your application's lifecycle. Repeatedly creating new `Apprise` instances (e.g., inside a loop or for every notification) can lead to unnecessary overhead and inefficient resource usage.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}