Notify you when a function finished with option to send a email or message to discord channel
Project description
Notifier Function Status
This library uses a decorator to show a toast in your screen or send you a email, message to discord channel or use a Telegram bot to send you a message when your function has finished.
Requeriments
Please install this packages by yourself depending on your OS:
- Windows:
pip3 install win10toast
- Ubuntu:
apt-get install libnotify-bin
(if don't work try searching how install notify-send for your distro of Linux)
Usage
All that you need to do is use a decorator and some specific parameters, like in the following example:
from notifier import notify
@notify(email='enmanuelmag@cardor.dev')
def your_function():
print('Hello World!')
Parameters
- title: the title of toast notification, by defult is:
Function finished
. - email: the email of user, by defult is:
None
. - api_token: the api token of your Telegram bot, by defult is:
None
. You could use BotFather to create a personal bot. - chat_id: the chat id to send the message, by defult is:
None
. If you account is public you could use your username (@username), otherwise you could use the chat id, you'll find here. - webhook_url: the url of webhook to send message to discord channel, by defult is:
None
. - msg: the message of toast notification, by default is:
Your function has finished
. - duration: the time, in seconds, that the nottications will show, by default is
8
. - urgency: the urgency of the notifcation. By defualt is
normal
. The options are:- low.
- normal.
- critical.
Made with ❤️ by Enmanuel Magallanes
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
notify_function-1.2.2.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file notify_function-1.2.2.tar.gz
.
File metadata
- Download URL: notify_function-1.2.2.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 135f0d5e827c08ec466a181ea479cabbb9d0d0527400708738fdd983c2e79424 |
|
MD5 | 3a8b9695d5cb81fcf32bc6f868b50d1f |
|
BLAKE2b-256 | faeb4f3e8af14afddef7b7bd4b588174e689e06461d9f514630f98fbffed9be9 |
File details
Details for the file notify_function-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: notify_function-1.2.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b9c1d876cecfd68f02153d54548ad0577b1a5a8635d8faccd48963772b490f5 |
|
MD5 | 2f14106372be8503a5cfaac1d9e9eec9 |
|
BLAKE2b-256 | 902a385507e2244c79b499d30b7bd77844652f8bda82bf94d9e31949514455a4 |