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.
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
if __name__ == "__main__":
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:
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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e42ae62b085e0885fc3742c64457bba78c7ae0c3bd4e42ed3425de642da4f91 |
|
MD5 | 2a79a2cf55b142775c9b07d3078d0338 |
|
BLAKE2b-256 | c3a74701a94c927051dcb0b7439f71cf11b4ab444a3955bae0a11fc590883470 |
Hashes for macos_notifications-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b232364264efd780acb47e2e4eade13617a68d3b2cbd29370f6ec468bd5317b7 |
|
MD5 | d3683ae2e27b66693ea05da59ee1e0ec |
|
BLAKE2b-256 | ef0d9a1899b2f2de1f6f8640225ffd465373bb259f728345ed6849e1e843adca |