Welcome to pynotification’s documentation!

PyNotification

Module to trigger OS agnostic notifications.

pynotification.pynotifier.default_logger() Logger

Configure default logger.

Returns:

Returns the Logger object as an argument.

Return type:

Logger

pynotification.pynotifier.pynotifier(title: AnyStr, message: AnyStr, dialog: bool = False, icon: Optional[Union[str, PathLike]] = None, debug: bool = False, logger: Optional[Logger] = None, destroy: bool = False) None

Triggers a system notification.

Parameters:
  • title – Title for the notification.

  • message – Message that has to go in the notification window.

  • dialog – Boolean value to show a dialog window. Note that this will block the process.

  • icon – Add a custom icon for Linux or Windows OS.

  • debug – Boolean value to show output logs.

  • logger – Bring your own logger for custom logging.

  • destroy – Destroy notification balloon immediately on Windows OS.

See also

  • Personalized icons for Linux OS

  • Both Linux and Windows OS support custom icon file for notifications.

  • .png for Linux

  • .ico for Windows

Warning

  • Please note that using this module doesn’t guarantee a pop-up notification.

  • This module uses built-in tools to trigger a notification.

  • How the notification is displayed solely relies on the system settings.

Module

Module to trigger notifications in WindowsOS, using windows binaries for API and GUI.

>>> WindowsNotifications
class pynotification.mod.WindowsBalloonTip(title: str, msg: str, icon: Union[str, PathLike], debug: bool, logger: Logger, destroy: bool)

Instantiates WindowsBalloonTip object as a dedicated process to trigger notification in Windows OS.

>>> WindowsBalloonTip

Initialize the object and assign create members for arguments received.

Parameters:
  • title – Title of the notification.

  • msg – Message for the notification.

  • debug – Boolean value to show output logs.

  • logger – Bring your own logger to log in any fashion.

  • destroy – Destroy notification balloon immediately.

run() None

Create a window class and sends a notification.

notify() Union[bool, str]

Run notification as balloon window tip.

Returns:

Returns a boolean flag if notification was successful, otherwise the error string.

Return type:

Union[bool, str]

on_destroy(*args, **kwargs) None

Destroys the notification window created.

Parameters:
  • *args – Arguments.

  • **kwargs – Keyword arguments.

Keyword Arguments:

lparam (hwnd, msg, wparam,) –

Window

Module to trigger notification in a message box.

class pynotification.window.DialogWindow(title: AnyStr, message: AnyStr, debug: bool, logger: Logger)

Module to show pop-up dialog window that blocks the process until a button is clicked.

>>> DialogWindow

Instantiate all the required args.

Parameters:
  • title – Title for the notification.

  • message – Message that has to go in the notification window.

  • debug – Boolean value to show output logs.

  • logger – Bring your own logger for custom logging.

mac_dialog() bool

Handle dialog window for macOS.

win_dialog() bool

Handle dialog window for Windows.

lin_dialog() bool

Handle dialog window for Linux.

Indices and tables