Toasters#

Classes#

windows_toasts.toasters.ToastNotificationT

Invariant TypeVar constrained to winrt.windows.ui.notifications.ToastNotification and winrt.windows.ui.notifications.ScheduledToastNotification.

windows_toasts.toasters.BaseWindowsToaster(...)

Wrapper to simplify WinRT's ToastNotificationManager

windows_toasts.toasters.WindowsToaster(...)

Basic toaster, used to display toasts without actions and/or inputs.

windows_toasts.toasters.InteractableWindowsToaster(...)

WindowsToaster, but uses a AUMID to support actions.

Data#

windows_toasts.toasters.ToastNotificationT = TypeVar(ToastNotificationT, ToastNotification, ScheduledToastNotification)#

Type:    TypeVar

Invariant TypeVar constrained to winrt.windows.ui.notifications.ToastNotification and winrt.windows.ui.notifications.ScheduledToastNotification.

API#

class windows_toasts.toasters.BaseWindowsToaster(applicationText: str)[source]#

Wrapper to simplify WinRT’s ToastNotificationManager

Parameters:

applicationText – Text to display the application as

notifierAUMID: str | None#
toastNotifier: winrt.windows.ui.notifications.ToastNotifier#
applicationText: str#
show_toast(toast: Toast) None[source]#

Displays the specified toast notification. If toast has already been shown, it will pop up again, but make no new sections in the action center

Parameters:

toast – Toast to display

update_toast(toast: Toast) bool[source]#

Update the passed notification data with the new data in the clas

Parameters:

toast (Toast) – Toast to update

Returns:

Whether the update succeeded

schedule_toast(toast: Toast, displayTime: datetime) None[source]#

Schedule the passed notification toast. Warning: scheduled toasts cannot be updated or activated (i.e. on_X)

Parameters:
  • toast (Toast) – Toast to display

  • displayTime (datetime) – Time to display the toast on

unschedule_toast(toast: Toast) None[source]#

Unschedule the passed notification toast

Raises:

ToastNotFoundError: If the toast could not be found

clear_toasts() None[source]#

Clear toasts popped by this toaster

clear_scheduled_toasts() None[source]#

Clear all scheduled toasts set for the toaster

class windows_toasts.toasters.WindowsToaster(applicationText: str)[source]#

Basic toaster, used to display toasts without actions and/or inputs. If you need to use them, see InteractableWindowsToaster

Parameters:

applicationText – Text to display the application as

show_toast(toast: Toast) None[source]#

Displays the specified toast notification. If toast has already been shown, it will pop up again, but make no new sections in the action center

Parameters:

toast – Toast to display

class windows_toasts.toasters.InteractableWindowsToaster(applicationText: str, notifierAUMID: str | None = None)[source]#

WindowsToaster, but uses a AUMID to support actions. Actions require a recognised AUMID to trigger on_activated, otherwise it triggers on_dismissed with no arguments

Parameters:
  • applicationText – Text to display the application as

  • notifierAUMID – AUMID to use. Defaults to Command Prompt. To use a custom AUMID, see one of the scripts