Cross-platform desktop notification library for Python
Project description
notify.py
Cross platform desktop notifications for Python scripts and applications.
How are they sent?
- Windows
- Notifications are natively sent with
windows.ui.notifications
through Powershell.
- Notifications are natively sent with
- macOS
- Notifications are sent with a bundled .app.
- Please read below on setting application icons.
- Notifications are sent with a bundled .app.
- Linux
- Notifications are sent with notify-send.
No dependencies are required other than loguru.
Install
- PyPi
pip install "notify-py"
- Install the latest development build
- Install the wheel from Github Releases Tab.
Usage
# Send a simple text notification.
import notifypy
notification = notifypy.Notify()
notification.send()
# This sends a notification with the default values.
# Updating the values
notification.title = "Really Cool Title"
notification.message = "Even cooler message."
notification.icon = "path/to/icon.png"
notification.application_name = "SuperCoolApp"
notification.send()
import notifypy
# You can quickly initalize with a 'default' message.
notifification = notifypy.Notify(
default_notification_title="Function completed",
defualt_application_name="SuperLongFunction"
)
def super_long_function():
# super long stuff here
result = result_of_long_function
notification.message = str(result_of_long_function)
notification.send()
import notifypy
notification = notify.Notify()
# Send the notification without blocking.
notification.send(block=False)
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.
- This is blocking. This will block most programs when sending the notification. This will be changed in the future. This may cause GUI applications to freeze. Do your own testing. v0.0.8.
- There is no support for sending custom sounds, and is silent for most platforms. (notable exclusion is windows.). This will be changed in the future.
- macOS does not support custom icons OTF. 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.
Special Thanks
-
https://github.com/go-toast/toast - Ported their Windows 10 toast notification to Python.
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
notify_py-0.0.8.tar.gz
(10.4 kB
view hashes)
Built Distribution
notify_py-0.0.8-py3-none-any.whl
(733.8 kB
view hashes)
Close
Hashes for notify_py-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b1918d296c5a98ee2f13f4e9d3176678c25b962ee438bcf3bd856d0e9dbdd86 |
|
MD5 | 2ebb94a4ba5ec817e02650f3775d45b4 |
|
BLAKE2b-256 | bbb84d60dee5298e9ea313e7e802cf0035edb334dbd8482a92d3656eab7890fa |