Cross-platform desktop notification library for Python
Project description
notify.py
Cross platform desktop notifications for Python scripts and applications.
Docs
You can read the docs on this Git's Wiki, or here
Supported Platforms.
- Windows 10
- macOS 10 >=10.10
- Linux (libnotify)
No dependencies are required other than loguru.
Install
pip install notify-py
Usage
Send Simple Notification
from notifypy import Notify
notification = Notify()
notification.title = "Cool Title"
notification.message = "Even cooler message."
Send Notification With Icon
from notifypy import Notify
notification = Notify()
notification.title = "Cool Title"
notification.message = "Even cooler message."
notification.icon = "path/to/icon.png"
notification.send()
Send Notification With Sound
from notifypy import Notify
notification = Notify()
notification.title = "Cool Title"
notification.message = "Even cooler message."
notification.audio = "path/to/audio/file.wav"
notification.send()
Sending Notifications without blocking
from notifypy import Notify
notification = Notify()
notification.send(block=False)
Sending with Default Notification Titles/Messages/Icons
from notifypy import Notify
notification = Notify(
default_notification_title="Function Message",
default_application_name="Great Application",
default_notification_icon="path/to/icon.png",
default_notification_audio="path/to/sound.wav"
)
def your_function():
# stuff happening here.
notification.message = "Function Result"
notification.send()
Important Caveats
-
As it stands (May 18, 2020), this is simply a notification service. There is no support for embedding custom actions (buttons, dialogs) regardless of platform. Other then telling you if the shell command was sent, there is also no confirmation on user action on the notification.
-
macOS does not support custom icons on the fly.. You will need to bundle a customized version of the notifier embedded with your custom icon.
Windows Specific.
- No support for balloon tips (pre Win10).. This will be changed in the future.
Contributors
Inspiration and Special Thanks
-
https://github.com/go-toast/toast - Ported their Windows 10 toast notification to Python.
-
https://notificationsounds.com/notification-sounds/done-for-you-612 example_notification_sound.wav
Contributing
Contributions are welcome.
- Tests are ran against all platforms.
- Black formatting is required.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for notify_py-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8842349e6e4ea68f38214f858a169b99d81731822737a1d461c52244d196c64 |
|
MD5 | f98bd98a3fc4b6eec666e0c7d490ba22 |
|
BLAKE2b-256 | 184f156896243215ad6a637aa0397b07be50e1b66ae4145d84d2436b54b845e7 |