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 functools import partial
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_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.4.tar.gz (618.2 kB view details)

Uploaded Source

Built Distribution

macos_notifications-0.1.4-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for macos-notifications-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ee922598f3e4d9433d7bd1f9ed0479d45109b9cf3ebdd6dae2a43ac195ece94f
MD5 120e012186d157b79b3ca08a9005203a
BLAKE2b-256 3ffdfc3a233dc8445679f34f7413cc03251bb54df5e6817335587532e560375e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for macos_notifications-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d85551feb1153a316e7fe8d6e13976a52be49e3f397f058c1f72eb97258e2866
MD5 4ddd55cf24abda53baa76e38562c9bc6
BLAKE2b-256 79dbfbe7ae0ed90f10c79d9be3b4fd25a362cffca7e1c090aaf6ab02f1aa22f1

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