Simple interactable Mac notifications with only pure-python dependencies
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for macos-notifications-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfbc3190550d5ff43f0547da34423466fb253ea337a86581d5324f77361a112b |
|
MD5 | e2b7101e18853b5a15a7f999d86e250f |
|
BLAKE2b-256 | f74c592409f9576a4c91de4928508ed67e3c15c3c1022cd47e2d8d0f94bcd011 |
Hashes for macos_notifications-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93590d762b82814989218cf5530dab52e3f35509ffb196adc039bf610c5073db |
|
MD5 | 84707fa00e1cf368039e731c09989822 |
|
BLAKE2b-256 | 48251265b689b07d09b272211e6b5e87924674f5421d235f421c7710927a52e4 |