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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f0594458727df74a890a1aee07594fe570fb56c83f38886763f9888b133824f |
|
MD5 | 6215b5cb9762968e956adf2a209784fd |
|
BLAKE2b-256 | ef069654820157ed1df88000d049fbd7912f6f9593bf1125add86281dd23a0f0 |
Hashes for macos_notifications-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0e36b8c2063fe71c6a78c77b4156156bd0104d9edd141321daf2af043994a79 |
|
MD5 | ae34081b09131a4a891b903bf6bc1bdc |
|
BLAKE2b-256 | 2816b16200d5222a4f05aff6178b62df48b785e186e85f1c53fcb0b4cfa528a9 |