Skip to main content

A Python module for Windows 10 toast notifications

Project description

Malachi - Windows 10 Toast Notifications

Overview

Malachi is a Python module designed to create Windows 10 toast notifications. It is a customized version of the win10toast_click module, which is no longer maintained. This module allows users to display notifications with custom icons, messages, and click callbacks.

Features

  • Display Windows 10 toast notifications.
  • Support for custom icons.
  • Configurable duration for notifications.
  • Threaded notifications to avoid blocking.
  • Callback functionality for mouse clicks within the notification window.

Installation

To install the module, use the following command:

pip install malachi

Usage

Basic Notification

from malachi import ToastNotifier

notifier = ToastNotifier()
notifier.show_toast(
    title="Notification Title",
    msg="This is a sample notification message",
    duration=5
)

Notification with Custom Icon

notifier.show_toast(
    title="Custom Icon Notification",
    msg="This notification has a custom icon",
    icon_path="path/to/icon.ico",
    duration=5
)

Threaded Notification

notifier.show_toast(
    title="Threaded Notification",
    msg="This notification runs in a separate thread",
    threaded=True
)

Notification with Click Callback

def on_click():
    print("Notification clicked!")

notifier.show_toast(
    title="Clickable Notification",
    msg="Click me!",
    callback_on_click=on_click
)

API Reference

ToastNotifier

show_toast

Displays a toast notification.

Parameters:

  • title (str): The title of the notification.
  • msg (str): The message to display.
  • icon_path (str, optional): Path to the .ico file for the notification icon.
  • duration (int, optional): Duration in seconds before the notification self-destructs. Set to None for no self-destruction.
  • threaded (bool, optional): Whether to run the notification in a separate thread.
  • callback_on_click (callable, optional): Function to call when the notification is clicked.

notification_active

Checks if there is an active notification.

Returns:

  • bool: True if a notification is active, False otherwise.

License

This project is licensed under the MIT License.

Acknowledgments

This module is inspired by the win10toast_click module created by jithurjacob.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

malachi-1.0.3.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

malachi-1.0.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file malachi-1.0.3.tar.gz.

File metadata

  • Download URL: malachi-1.0.3.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for malachi-1.0.3.tar.gz
Algorithm Hash digest
SHA256 6f0458133a83836bc7307ff7a88eb656f351566363c2bc6c05de9b937ef66153
MD5 29d9ebc62333b8d642b52b71f5f29a75
BLAKE2b-256 9499027887961748c85b2f56796d8b6ba7a3b109bbac5a3e9c3785b0dd737919

See more details on using hashes here.

File details

Details for the file malachi-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: malachi-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for malachi-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5ca287f03f47efcdd26b547787308ad7c1cff3c27623f790dd8d71260eba1a4f
MD5 02089e287bda96fcf9cbfa5c18e4f066
BLAKE2b-256 e4f71f65ce34dc27fe5fb87ed33210d0729cf1270a2ed69d57c3b1282bfe06d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page