Skip to main content

WindowsOptions

Presentation settings for Windows toast notifications.

Note

URI and file values refer to resources available on the Windows device, not files on the Python server. Windows version and packaging determine which toast features are available.

Properties

  • bindings - Substitution values for named bindings in Windows toast content.
  • duration - Requested toast display duration.
  • header - Header text used to group Windows notifications.
  • images - Image URI strings to include in the toast.
  • loop_sound - Whether sound repeats until the notification is dismissed.
  • progress - Progress bar shown in the toast.
  • scenario - Toast scenario controlling layout and default audio; see WindowsScenario.
  • sound - The sound to be played when the toast is displayed.
  • subtitle - Additional text line displayed below the notification body.
  • timestamp - Time displayed on the toast.

Properties​

bindingsclass-attributeinstance-attribute​

bindings: dict[str, str] | None = None

Substitution values for named bindings in Windows toast content.

Keys identify bindings and values provide the text to substitute. These values do not create additional rows or progress bars by themselves.

durationclass-attributeinstance-attribute​

duration: WindowsDuration | None = None

Requested toast display duration.

See WindowsDuration. The scenario and Windows settings can influence the actual duration.

headerclass-attributeinstance-attribute​

header: str | None = None

Header text used to group Windows notifications.

Sets the visible title of a header with the fixed ID "header" and no activation arguments.

imagesclass-attributeinstance-attribute​

images: list[str] | None = None

Image URI strings to include in the toast.

Use URIs accessible to Windows, such as file:///C:/images/status.png. Images use default placement and empty alternative text.

loop_soundclass-attributeinstance-attribute​

loop_sound: bool | None = None

Whether sound repeats until the notification is dismissed.

Note

Windows loops sound only for notifications that stay on screen: those with a scenario of ALARM, REMINDER or INCOMING_CALL, or a long duration. Use it with the alarm and call sounds, which are made to loop.

progressclass-attributeinstance-attribute​

progress: WindowsProgress | None = None

Progress bar shown in the toast.

scenarioclass-attributeinstance-attribute​

scenario: WindowsScenario | None = None

Toast scenario controlling layout and default audio; see WindowsScenario.

soundclass-attributeinstance-attribute​

sound: WindowsSound | None = None

The sound to be played when the toast is displayed.

Custom audio URIs and arbitrary ms-winsoundevent names are not supported.

subtitleclass-attributeinstance-attribute​

subtitle: str | None = None

Additional text line displayed below the notification body.

timestampclass-attributeinstance-attribute​

timestamp: datetime | None = None

Time displayed on the toast.

Overrides the displayed time without changing when the notification is delivered. None uses the system's posting time.

Timezone-aware values preserve their instant. A naive datetime is interpreted in the Python host's local timezone.