Notify-py is a cross-platform Python library designed for sending desktop notifications on Windows, macOS, and Linux. It simplifies the process of displaying alerts, messages, and system notifications from Python scripts and applications. Currently at version 0.3.43, the library is actively maintained with frequent patch releases addressing bug fixes and minor improvements.
pip install notify-pyVerified import paths — ran on the pinned version, not inferred.
This basic example demonstrates how to create a simple desktop notification with a title and message. You can optionally add an icon or a custom sound. For non-blocking behavior, set `block=False` on the `send()` method.
If passing a custom notifier object, use the new `use_custom_notifier` keyword argument. If overriding the detected platform name, continue to use `override_detected_notification_system` with a string value.
For macOS, consider bundling your application with a pre-configured notifier binary that includes your desired icon, or rely on system-default icon behavior. This is a limitation of macOS notification system integration.
If interactive notifications are required, an alternative library or a platform-specific solution that allows for user interaction will be necessary. Notify-py is designed only for displaying messages.
Initialize the `Notify` object with `enable_logging=True`: `notification = Notify(enable_logging=True)`.
Upgrade `notify-py` to version `0.3.43` or newer using `pip install --upgrade notify-py`.
Use the correct keyword argument `use_custom_notifier` when passing a custom notifier object. The `override_detected_notification_system` argument should now be used to pass a string representing a custom platform name.
To enable logging for debugging or verbose output, initialize the `Notify` object with `enable_logging=True`, like `notification = Notify(enable_logging=True)`.