Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ms7m/notify-py
:speech_balloon: | A simple Python Module for sending cross-platform desktop notifications on Windows, macOS and Linux
https://github.com/ms7m/notify-py
desktop-notifications hacktoberfest linux-notifications mac-notifications notifications python windows-notifications
Last synced: about 1 month ago
JSON representation
:speech_balloon: | A simple Python Module for sending cross-platform desktop notifications on Windows, macOS and Linux
- Host: GitHub
- URL: https://github.com/ms7m/notify-py
- Owner: ms7m
- License: mit
- Created: 2020-05-16T06:04:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-08T13:59:26.000Z (8 months ago)
- Last Synced: 2024-04-25T06:19:24.454Z (8 months ago)
- Topics: desktop-notifications, hacktoberfest, linux-notifications, mac-notifications, notifications, python, windows-notifications
- Language: Python
- Homepage:
- Size: 16.2 MB
- Stars: 237
- Watchers: 7
- Forks: 26
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-awesome-github-stars - ms7m/notify-py - :speech_balloon: | A simple Python Module for sending cross-platform desktop notifications on Windows, macOS and Linux (Python)
README
notify.py
Cross platform desktop notifications for Python scripts and applications.
## Docs
You can read the docs on this Git's Wiki, or [here](https://ms7m.github.io/notify-py/)
## Supported Platforms.
- Windows 10/11
- macOS 10 >=10.10
- Linux (libnotify)No dependencies are required other than loguru & jeepney (Only for linux/DBUS).
---
## Install
```
pip install notify-py
```---
## Usage
**Send Simple Notification**
```python
from notifypy import Notify
notification = Notify()
notification.title = "Cool Title"
notification.message = "Even cooler message."
notification.send()
```**Send Notification With Icon**
```python
from notifypy import Notify
notification = Notify()
notification.title = "Cool Title"
notification.message = "Even cooler message."
notification.icon = "path/to/icon.png"notification.send()
```**Send Notification With Sound**
```python
from notifypy import Notify
notification = Notify()
notification.title = "Cool Title"
notification.message = "Even cooler message."
notification.audio = "path/to/audio/file.wav"notification.send()
```
**Sending Notifications without blocking**
```python
from notifypy import Notify
notification = Notify()
notification.send(block=False)```
**Sending with Default Notification Titles/Messages/Icons**
```python
from notifypy import Notify
notification = Notify(
default_notification_title="Function Message",
default_application_name="Great Application",
default_notification_icon="path/to/icon.png",
default_notification_audio="path/to/sound.wav"
)def your_function():
# stuff happening here.
notification.message = "Function Result"
notification.send()
```---
# CLI
A CLI is available when you install notify-py```bash
notifypy --title --message --applicationName --iconPath --soundPath
```
You may need to add ``python3 -m`` to the beginning.---
## Important Caveats
- As it stands (May 18, 2020), this is simply a notification service. There is _no_ support for embedding custom actions (buttons, dialogs) regardless of platform. Other then telling you if the shell command was sent, there is also no confirmation on user action on the notification.
- macOS does **not** support custom icons on the fly.. You will need to bundle a customized version of the notifier embedded with your custom icon.
---
### Windows Specific.
- No support for balloon tips (pre Win10).. This will be changed in the future.
---
### Contributors
- [Leterax](https://github.com/Leterax)
- [jnoortheen](https://github.com/jnoortheen)
- [dynobo](https://github.com/dynobo)
- [Xou](https://github.com/GiorgosXou)---
### Inspiration and Special Thanks
- https://github.com/go-toast/toast - Ported their Windows 10 toast notification to Python.
- [Vítor Galvão](https://github.com/vitorgalvao) for https://github.com/vitorgalvao/notificator
- https://notificationsounds.com/notification-sounds/done-for-you-612 example_notification_sound.wav
- https://github.com/mikaelbr/node-notifier
---
# Contributing
Contributions are welcome!
Please base your changes on the latest development branch and open a PR to that branch. PR will not be accepted to the master branch. Tests are ran against all platforms.
### Setting Up Environment
- Install [Poetry](https://python-poetry.org/)
- `poetry install`
- Add patches/new features/bug fiexes
- Run tests
- `poetry run pytest tests/*`
- Run lints
- `poetry run pylint --errors-only notifypy/`
- Run Black Formatting
- `poetry run black notifypy`
- Open PR to `dev` branch.
- Add your name to contributors list if you wish!