Skip to main content

Simple interactable Mac notifications with only pure-python dependencies

Project description

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-notifications

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 mac_notifications import client

client.create_notification(
    title="Meeting starts now!",
    subtitle="Team Standup",
    icon="/Users/jorrick/zoom.png",
    action_button_str="Join zoom meeting",
    action_button_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

Why did you create this library?

I wanted a library that did not depend on any non-python tools (so you had to go around and install that). Instead, I wanted a library where you install the pip packages, and you are done. Later I realised how hard it was to integrate correctly with PyOBJC. Also, I had a hard time finding any examples on how to easily integrate this in a non-blocking fashion with my tool. Hence, I figured I should set it up to be as user-friendly as possible and share it with the world ;)!

Limitations

Although there are some limitations, there is no reason to not use it now :v:.

  • 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

macos-notifications-0.1.2.tar.gz (617.9 kB view details)

Uploaded Source

Built Distribution

macos_notifications-0.1.2-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file macos-notifications-0.1.2.tar.gz.

File metadata

  • Download URL: macos-notifications-0.1.2.tar.gz
  • Upload date:
  • Size: 617.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for macos-notifications-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5c8bff8a004afd32bce8c7b46f1a60a776b7c0c4db8995fdb293a99feb8634be
MD5 05ef54627a6e7bb976dd9cc5facb037a
BLAKE2b-256 e719aa9cd6322951037a7584a6eae6fd530fc9ddb6da08a74b86ca91591b9cdd

See more details on using hashes here.

Provenance

File details

Details for the file macos_notifications-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for macos_notifications-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b00a33111602e6876a714ba1f1cc2cd85ed738b50603e5b5cf596bfc2ccc693
MD5 802ea440e82bf7db6efd2af1043827fc
BLAKE2b-256 df40fc079eb92bf2ae4f62d873836c2755bc228eb474fe3c4c7e1280983b1f7c

See more details on using hashes here.

Provenance

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