Registry / communication / notify-py

notify-py

JSON →
library0.3.43pypypi✓ verified 84d ago

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-py
INSTALL
IMPORT
SIG · NOTIFY-PY
N
notify-py
communicationpythonv0.3.43
Install
1.7s avg
Import
301ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.43 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.319s · 19.9MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.7s · import 0.282s · 20MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Notify
from notifypy import Notify

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.

from notifypy import Notify notification = Notify() notification.title = "My Application Alert" notification.message = "This is a test notification from notify-py!" # Optional: Set an icon (path to .png) and sound (path to .wav) # notification.icon = "/path/to/my_icon.png" # notification.audio = "/path/to/my_sound.wav" # To prevent blocking the main thread (runs notification in background): # notification.send(block=False) notification.send()
Debug
Known issues
breakingThe `override_detected_notification_system` keyword argument was repurposed in v0.3.0. It now accepts a custom platform name (string) instead of a custom notifier object.
fix
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.
affects: <0.3.0
gotchaOn macOS, custom icons cannot be set dynamically for notifications. You must bundle a customized version of the notifier with your custom icon to display it.
fix
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.
affects: All versions
gotchaNotify-py notifications are purely informational and do not support interactive elements like buttons or custom actions.
fix
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.
affects: All versions
gotchaLogging within `notify-py` is disabled by default to minimize output. If you need to see internal library logs (e.g., for debugging), it must be explicitly enabled.
fix
Initialize the `Notify` object with `enable_logging=True`: `notification = Notify(enable_logging=True)`.
affects: 0.2.2 and later
Errors
Common errors & fixes
notifypy.exceptions.UnsupportedPlatform: This version of Windows (11) is not supported.
This error occurred on Windows 11 with Python 3.12 in `notify-py` versions prior to `0.3.43` due to an incompatibility with the Windows notification backend.
fix
Upgrade `notify-py` to version `0.3.43` or newer using `pip install --upgrade notify-py`.
TypeError: Notify.__init__() got an unexpected keyword argument 'override_detected_notification_system'
Attempting to pass a custom notifier object using the `override_detected_notification_system` keyword argument in versions 0.3.0 or later, after the argument was repurposed.
fix
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.
No logging messages from notify-py are appearing in console or logs.
By default, `notify-py` disables its internal logging to prevent excessive output, especially in production environments.
fix
To enable logging for debugging or verbose output, initialize the `Notify` object with `enable_logging=True`, like `notification = Notify(enable_logging=True)`.
Upgrade
Version history
0.3.43latest on PyPI · released Jun 5, 2024
Audit
Dependencies
logururequiredRequired for internal logging; it's the primary runtime dependency.
jeepneyoptionalRequired for D-Bus communication to send notifications on Linux systems.
Agent activity
34 hits · last 30 days
node
32
OpenAI (training)
1
Resources
notify-py — pip install notify-py · libregistry