https://github.com/puilp0502/python-webnoti
Simple Python library for sending Web Push Notification
https://github.com/puilp0502/python-webnoti
notifications push-notifications python web
Last synced: 5 months ago
JSON representation
Simple Python library for sending Web Push Notification
- Host: GitHub
- URL: https://github.com/puilp0502/python-webnoti
- Owner: puilp0502
- License: mit
- Created: 2017-02-21T17:57:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-04-22T17:34:09.000Z (about 5 years ago)
- Last Synced: 2025-09-05T00:39:36.708Z (10 months ago)
- Topics: notifications, push-notifications, python, web
- Language: Python
- Size: 14.6 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
python-webnoti
==============
Easy-to-use Python Web Push Notification Library
Installation
------------
Install with pip:
.. code:: sh
$ pip install python-webnoti
Usage
-----
To send a notification:
.. code:: python
from webnoti import send_notification, get_private_key
send_notification(subscription, "Hello from server") # For Firefox
send_notification(subscription, "Hello from server", # For Chrome
'mailto:admin@example.com', get_private_key('privkey.pem', generate=True))
# subscription can be obtained from the client.
To manually generate private key:
.. code:: python
from webnoti import get_private_key
get_private_key('privkey.pem', b'password', generate=True)
This will generate private key named `privkey.pem` with password `password` (None if not encrypted) in current working directory.
Check out `python-webnoti-example `_
for the full example.