Skip to content

Mac Notifications

macos-notifications

Mac supported Package version Supported Python versions


Documentation: https://jorricks.github.io/macos-notifications/

Source Code: https://github.com/Jorricks/macos-notifications


mac-notification is a Python library to make it as easy as possible to create interactable notifications.

Installation

To use macos-notifications, first install it using pip:

pip install macos-notificationsInstalled

Features

  • 🚀 Easy python interface. It's as simple as 'client.create_notification(title="Meeting starts now!", subtitle="Team Standup")'
  • 💥 Ability to add action buttons with callbacks!
  • 📝 Ability to reply to notifications!
  • ⌚ Delayed notifications.
  • ⏱️ Automatically time out the notification listener.
  • 📦 Just pyobjc as a dependency.

Example

from functools import partial
from mac_notifications import client

if __name__ == "__main__":
    client.create_notification(
        title="Meeting starts now!",
        subtitle="Team Standup",
        icon="/Users/jorrick/zoom.png",
        sound="Frog",
        action_button_str="Join zoom meeting",
        action_callback=partial(join_zoom_meeting, conf_number=zoom_conf_number)
    )
A simple example. Please look in the docs for more examples like this:

macos-notifications

Limitations

  • You need to keep your application running while waiting for the callback to happen.
  • Currently, we are only supporting the old deprecated user notifications. Soon we will also make the new implementation available.