Skip to content

This library is designed to easily implement notifications with images and sounds in your Python scripts.

License

Notifications You must be signed in to change notification settings

kokaito-git/knotification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This library is designed to easily implement notifications with images and sounds in your Python scripts.

Please note that the number of imports is considerable, and users of the script will need to install some dependencies depending on their operating system. Additionally, the design may change.

Credits

Install && Dependencies

pip install knotification

# Installed automatically (dependencies of knotification)
# pip install py-notifier
# pip install pygame
# pip install WinToaster (in windows)

# Manual installation required
# Linux (Arch/Debian)
sudo pacman -S libnotify
sudo apt-get install libnotify-bin

# Other Linux distributions/Mac
# I'm sorry but I'm still not sure.

Sample Usage

from knotification import KNotification
from knotification.sample import (
    SND_NOTIFY,
    SND_ERROR,
    SND_ERROR2,
    IMG_NOTIFY,
    IMG_ERROR,
)
import time

notify = KNotification(
    default_title="KNotification",
    default_sound=SND_NOTIFY,
    default_image=f"{IMG_NOTIFY}",
)
error = KNotification(default_sound=SND_ERROR, default_image=f"{IMG_ERROR}")

notify.send("Thanks for using my software")
time.sleep(1)
error.send(f"[!] Error: Not enough resources.\n\nCheck the manual.")
time.sleep(1)
error.send(f"[!] Error: Not enough notifies.", duration=20, sound=SND_ERROR2)

KNotifySound

Optionally used to store sounds in variables, preload them, and avoid specifying the path to the sound each time you use a different sound than the default one set in KNotification (if you choose to set a default sound).

KNotification

Used to create a notification object where you can set default settings, though you can always specify the details of the notification explicitly for each dispatch. You can also create different notification objects, for example, one for errors and another for informational messages, allowing you to define different default details for each.

More Credits (All License: Creative Commons 0)

About

This library is designed to easily implement notifications with images and sounds in your Python scripts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages