Skip to main content

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/11
  • macOS 10 >=10.10
  • Linux (libnotify)

No dependencies are required other than loguru & jeepney (Only for linux/DBUS).


Install

pip install notify-py

Usage

Send Simple Notification

from notifypy import Notify

notification = Notify()
notification.title = "Cool Title"
notification.message = "Even cooler message."
notification.send()

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()

CLI

A CLI is available when you install notify-py

notifypy --title --message --applicationName --iconPath --soundPath

You may need to add python3 -m to the beginning.


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


Contributing

Contributions are welcome!

Please base your changes on the latest development branch and open a PR to that branch. PR will not be accepted to the master branch. Tests are ran against all platforms.

Setting Up Environment

  • Install Poetry
    • poetry install
  • Add patches/new features/bug fiexes
  • Run tests
    • poetry run pytest tests/*
  • Run lints
    • poetry run pylint --errors-only notifypy/
  • Run Black Formatting
    • poetry run black notifypy
  • Open PR to dev branch.
  • Add your name to contributors list if you wish!

Release files for notify_py 0.3.43

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for notify_py 0.3.43
File Size Uploaded
notify_py-0.3.43.tar.gz 648.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for notify_py 0.3.43
File Interpreter ABI Platform
notify_py-0.3.43-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / notify_py-0.3.43.tar.gz

Download URL notify_py-0.3.43.tar.gz
Size 648.1 kB
Tags Source
SHA-256 checksum
How to use checksums
16ee146d48f16bae5dad233db66014a387efd2c6ed2c4caf1e08aef432070513
BLAKE2b-256 checksum
How to use checksums
062bfc68aeed5108185922c5469484e15c192dff01d61eddfab0c1c256e4f54c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.6 Darwin/23.5.0

Release files / notify_py-0.3.43-py3-none-any.whl

Download URL notify_py-0.3.43-py3-none-any.whl
Size 649.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90da686b480bf05d033b21fb5118662bb7a4c68e68cb21d93a048ca7b867f9b4
BLAKE2b-256 checksum
How to use checksums
87b4649f16520ed0a64c275861dcaf9c1291d079f742aa2bf9102fdd168e4197
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.6 Darwin/23.5.0

Release history Release notifications | RSS feed

This release

0.3.43 This release

2 release files

0.3.42

2 release files

0.3.41

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page