Package: win11toast
win11toastToast notifications for Windows 10 and 11 based onWinRTInstallationpipinstallwin11toastUsagefromwin11toastimporttoasttoast('Hello Python🐍')https://docs.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-textBodyfromwin11toastimporttoasttoast('Hello Python','Click to open url',on_click='https://www.python.org')Wrap textfromwin11toastimporttoasttoast('Hello','Lorem ipsum dolor sit amet, consectetur adipisicing elit. Earum accusantium porro numquam aspernatur voluptates cum, odio in, animi nihil cupiditate molestias laborum. Consequatur exercitationem modi vitae. In voluptates quia obcaecati!')Run Python script on Clickfromwin11toastimporttoasttoast('Hello Pythonista','Click to run python script',on_click=r'C:\Users\Admin\Downloads\handler.pyw')# {'arguments': 'C:\\Users\\Admin\\Downloads\\handler.pyw', 'user_input': {}}Since the current directory when executing the script isC:\Windows\system32, useos.chdir()accordingly.e.g.handler.pywOn Windows, you can run a Python script in the background using the pythonw.exe executable, which will run your program with no visible process or way to interact with it.https://stackoverflow.com/questions/9705982/pythonw-exe-or-python-exeCallbackfromwin11toastimporttoasttoast('Hello Python','Click to open url',on_click=lambdaargs:print('clicked!',args))# clicked! {'arguments': 'http:', 'user_input': {}}Iconfromwin11toastimporttoasttoast('Hello','Hello from Python',icon='https://unsplash.it/64?image=669')Squarefromwin11toastimporttoasticon={'src':'https://unsplash.it/64?image=669','placement':'appLogoOverride'}toast('Hello','Hello from Python',icon=icon)Imagefromwin11toastimporttoasttoast('Hello','Hello from Python',image='https://4.bp.blogspot.com/-u-uyq3FEqeY/UkJLl773BHI/AAAAAAAAYPQ/7bY05EeF1oI/s800/cooking_toaster.png')https://docs.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-imageHerofromwin11toastimporttoastimage={'src':'https://4.bp.blogspot.com/-u-uyq3FEqeY/UkJLl773BHI/AAAAAAAAYPQ/7bY05EeF1oI/s800/cooking_toaster.png','placement':'hero'}toast('Hello','Hello from Python',image=image)Progressfromtimeimportsleepfromwin11toastimportnotify,update_progressnotify(progress={'title':'YouTube','status':'Downloading...','value':'0','valueStringOverride':'0/15 videos'})foriinrange(1,15+1):sleep(1)update_progress({'value':i/15,'valueStringOverride':f'{i}/15 videos'})update_progress({'status':'Completed!'})Attributeshttps://docs.microsoft.com/en-ca/uwp/schemas/tiles/toastschema/element-progresshttps://docs.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/toast-progress-barAudiofromwin11toastimporttoasttoast('Hello','Hello from Python',audio='ms-winsoundevent:Notification.Looping.Alarm')Available audiohttps://docs.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-audioFrom URLfromwin11toastimporttoasttoast('Hello','Hello from Python',audio='https://nyanpass.com/nyanpass.mp3')From filefromwin11toastimporttoasttoast('Hello','Hello from Python',audio=r"C:\Users\Admin\Downloads\nyanpass.mp3")I don't know how to add custom audio please help.https://docs.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/custom-audio-on-toastsLoopfromwin11toastimporttoasttoast('Hello','Hello from Python',audio={'loop':'true'})fromwin11toastimporttoasttoast('Hello','Hello from Python',audio={'src':'ms-winsoundevent:Notification.Looping.Alarm','loop':'true'})Silent🤫fromwin11toastimporttoasttoast('Hello Python🐍',audio={'silent':'true'})Speak🗣fromwin11toastimporttoasttoast('Hello Python🐍',dialogue='Hello world')OCR👀fromwin11toastimporttoasttoast(ocr='https://i.imgur.com/oYojrJW.png')fromwin11toastimporttoasttoast(ocr={'lang':'ja','ocr':r'C:\Users\Admin\Downloads\hello.png'})Long durationfromwin11toastimporttoasttoast('Hello Python🐍',duration='long')displayed for 25 secondshttps://docs.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-toastNo timeoutfromwin11toastimporttoasttoast('Hello Python🐍',scenario='incomingCall')The scenario your toast is used for, like an alarm, reminder, incomingCall or urgent.https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-toast#:~:text=None-,scenario,-The%20scenario%20yourButtonfromwin11toastimporttoasttoast('Hello','Hello from Python',button='Dismiss')# {'arguments': 'http:Dismiss', 'user_input': {}}fromwin11toastimporttoasttoast('Hello','Hello from Python',button={'activationType':'protocol','arguments':'https://google.com','content':'Open Google'})# {'arguments': 'https://google.com', 'user_input': {}}fromwin11toastimporttoasttoast('Hello','Click a button',buttons=['Approve','Dismiss','Other'])https://docs.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-actionPlay music or Open Explorerfromwin11toastimporttoastbuttons=[{'activationType':'protocol','arguments':'C:\Windows\Media\Alarm01.wav','content':'Play'},{'activationType':'protocol','arguments':'file:///C:/Windows/Media','content':'Open Folder'}]toast('Music Player','Download Finished',buttons=buttons)Inputfromwin11toastimporttoasttoast('Hello','Type anything',input='reply',button='Send')# {'arguments': 'http:Send', 'user_input': {'reply': 'Hi there'}}fromwin11toastimporttoasttoast('Hello','Type anything',input='reply',button={'activationType':'protocol','arguments':'http:','content':'Send','hint-inputId':'reply'})# {'arguments': 'http:', 'user_input': {'reply': 'Hi there'}}https://docs.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-inputSelectionfromwin11toastimporttoasttoast('Hello','Which do you like?',selection=['Apple','Banana','Grape'],button='Submit')# {'arguments': 'dismiss', 'user_input': {'selection': 'Grape'}}No argumentsfromwin11toastimporttoasttoast()Non blockingfromwin11toastimportnotifynotify('Hello Python','Click to open url',on_click='https://www.python.org')Asyncfromwin11toastimporttoast_asyncasyncdefmain():awaittoast_async('Hello Python','Click to open url',on_click='https://www.python.org')Jupyterfromwin11toastimportnotifynotify('Hello Python','Click to open url',on_click='https://www.python.org')fromwin11toastimporttoast_asyncawaittoast_async('Hello Python','Click to open url',on_click='https://www.python.org')importurllib.requestfrompathlibimportPathsrc=str(Path(urllib.request.urlretrieve("https://i.imgur.com/p9dRdtP.jpg")[0]).absolute())fromwin11toastimporttoast_asyncawaittoast_async('にゃんぱすー',audio='https://nyanpass.com/nyanpass.mp3',image={'src':src,'placement':'hero'})fromwin11toastimporttoast_asyncawaittoast_async('Hello Python🐍',dialogue='にゃんぱすー')Debugfromwin11toastimporttoastxml="""<toast launch="action=openThread&amp;threadId=92187"><visual><binding template="ToastGeneric"><text hint-maxLines="1">Jill Bender</text><text>Check out where we camped last weekend! It was incredible, wish you could have come on the backpacking trip!</text><image placement="appLogoOverride" hint-crop="circle" src="https://unsplash.it/64?image=1027"/><image placement="hero" src="https://unsplash.it/360/180?image=1043"/></binding></visual><actions><input id="textBox" type="text" placeHolderContent="reply"/><actioncontent="Send"imageUri="Assets/Icons/send.png"hint-inputId="textBox"activationType="background"arguments="action=reply&amp;threadId=92187"/></actions></toast>"""toast(xml=xml)Notifications VisualizerAcknowledgementswinsdk_toastWindows-ToastsMarcAlx/notification.py