Skip to content

Simple Python library for sending Web Push Notification

License

Notifications You must be signed in to change notification settings

puilp0502/python-webnoti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-webnoti

Easy-to-use Python Web Push Notification Library

Installation

Install with pip:

$ pip install python-webnoti

Usage

To send a notification:

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:[email protected]', get_private_key('privkey.pem', generate=True))
# subscription can be obtained from the client.

To manually generate private key:

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.

About

Simple Python library for sending Web Push Notification

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages