Skip to main content

Cross-platform desktop notification library for Python

Project description


notify.py

Cross platform desktop notifications for Python scripts and applications.

Test Linux Test macOS Test Windows

How are they sent?

  • Windows
    • Notifications are natively sent with windows.ui.notifications through Powershell.
  • macOS
    • Notifications are sent with a bundled .app.
      • Please read below on setting application icons.
  • 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

Project details


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)

Uploaded Source

Built Distribution

notify_py-0.0.8-py3-none-any.whl (733.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page