win10toast-click
An easy-to-use Python library for displaying Windows 10 Toast Notifications. Improved version of win10toast and win10toast-persist to include
callback_on_clickto run a function on notification click, for example to open a URL.
Context
1: Original module.
2: Tweaked version with support for notifications that persist in the notification center.
This fork is an improved version of 2 ^ with callback_on_click that allows to run a function on notification click, for example to open a URL.
Installation
pip install win10toast-click
Example
# modules
import webbrowser
from win10toast_click import ToastNotifier
# function
page_url = 'http://example.com/'
def open_url():
try:
webbrowser.open_new(page_url)
print('Opening URL...')
except:
print('Failed to open URL. Unsupported variable type.')
# initialize
toaster = ToastNotifier()
# showcase
toaster.show_toast(
"Example two", # title
"Click to open URL! >>", # message
icon_path=None, # 'icon_path'
duration=5, # for how many seconds toast should be visible; None = leave notification in Notification Center
threaded=True, # True = run other code in parallel; False = code execution will wait till notification disappears
callback_on_click=open_url # click notification to run function
)
Release History
- 0.1.2: Prepared for distribution on Python Package Index (PyPI).
- 0.1.1: Renamed repo.
- 0.1: Initial release.
Versioning
Using SemVer.
License
GNU General Public License v3.
Acknowledgements
Original modules
Stack Overflow
Packaging & distribution
- Packaging Python Projects
setuptoolsQuickstart- Data Files Support
- Configuring setup() using setup.cfg files
- pypa packaging-problems
Icon
Metadata
Release files for win10toast-click 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| win10toast_click-0.1.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Release files / win10toast_click-0.1.2-py2.py3-none-any.whl
| Download URL | win10toast_click-0.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 40.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f534ce5d03a55d8e7d8665abc99e1839825423cf2d968b526b5507efce512ebe
|
|
BLAKE2b-256 checksum How to use checksums |
16cb0f5d27b9b67ae9cf0e3d559582a3dce368410c432908a15f7bf9e01754b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/53.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.4
|
Security for win10toast-click 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.