Skip to main content

Simple interactable Mac notifications with only pure-python dependencies

Project description

macos-notifications

Mac supported Python 3.7+ supported


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.

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 two packages (which is really just one package) as a dependency

Installation

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

pip install macos-notifications

Requirements

Python 3.8+

Mac-notification only relies on pyobjc:

  • The PyObjC project aims to provide a bridge between the Python and Objective-C programming languages on macOS.

Example

A simple example. Please look in the docs for more examples.

from pathlib import Path
from mac_notifications import client

client.create_notification(
    title="Meeting starts now!",
    subtitle="Team Standup",
    icon=Path(__file__).parent / "zoom.png",
    action_button_str="Join zoom meeting",
    action_button_callback=partial(join_zoom_meeting, conf_number=zoom_conf_number)
)

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.1.tar.gz (133.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for macos-notifications-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bfbc3190550d5ff43f0547da34423466fb253ea337a86581d5324f77361a112b
MD5 e2b7101e18853b5a15a7f999d86e250f
BLAKE2b-256 f74c592409f9576a4c91de4928508ed67e3c15c3c1022cd47e2d8d0f94bcd011

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for macos_notifications-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 93590d762b82814989218cf5530dab52e3f35509ffb196adc039bf610c5073db
MD5 84707fa00e1cf368039e731c09989822
BLAKE2b-256 48251265b689b07d09b272211e6b5e87924674f5421d235f421c7710927a52e4

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