Simple interactable Mac notifications with only pure-python dependencies
Project description
Documentation: https://jorricks.github.io/mac-notifications/
Source Code: https://github.com/Jorricks/mac-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 mac-notifications, first install it using pip:
pip install mac-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.0.1a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b293928b34409636830b96268a5559e2be8e2319b738e73220b7b91bb9136536 |
|
MD5 | 50654e3a79ab553042a39df2bd51818d |
|
BLAKE2b-256 | 0384145cba60eee92a6625f952822b25cb557a4a0a21d6b4ac43211e6e208bed |
Hashes for macos_notifications-0.0.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e3fe3b15b1c6dd076d9c9c214beab5762bb065bee3ea98b83b2ab0add2c1fb9 |
|
MD5 | 660b4863708a63c7803da4b7fe02e02f |
|
BLAKE2b-256 | 21c390071c873944a2834e290d5d00efd16c6bfe899108e89593904190921be7 |