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
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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca73a7d492d2b8c53d0c41837bf2e3eee6d7be6f5caaea64ad53c4bf0e380555 |
|
MD5 | 3848643c7e3778be0d5a1c01afb1806a |
|
BLAKE2b-256 | 520c64d939d2d6cf824b9ff840532c3d271d870b09d6791d809e597d8cac7c23 |
Hashes for macos_notifications-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6cc3d3b03d8a0fa09b24f4c239971009df4ce99b440266c383adc901d48534a |
|
MD5 | 8c420586ed07be119b277a953a1fb66e |
|
BLAKE2b-256 | aa370a0f20491869977911bad6f0d8dac634ff789a889e8237e5aa91be57114b |