Python module to send push notifications via Simplepush.
Installation
pip3 install simplepush
Examples
All examples can be made asynchronous by using async_send instead of send.
- Send a push notification to the Simplepush key
YourKey:
import simplepush
simplepush.send(key='YourKey', title='Notification title', message='Notification message')
- Send a push notification with actions and a callback function that will print the selected action:
import simplepush
def callback(action_selected, action_selected_at, action_delivered_at, feedback_id):
print(action_selected)
simplepush.send(key='YourKey', title='Title', message='Actionable notification', actions=['yes', 'no', 'maybe'], feedback_callback=callback)
- Send an end-to-end encrypted push notification with actions and a callback function that will print the selected action and times out after 120 seconds:
import simplepush
def callback(action_selected, action_selected_at, action_delivered_at, feedback_id):
print(action_selected)
simplepush.send(key='YourKey', password='password', salt='salt', message='Actionable notification', actions=['yes', 'no', 'maybe'], feedback_callback=callback, feedback_callback_timeout=120)
- Send an end-to-end encrypted push notification with an image and a video file:
import simplepush
simplepush.send(key='YourKey', message='Attachments', password='password', salt='salt', attachments=['https://upload.wikimedia.org/wikipedia/commons/e/ee/Sample_abc.jpg', {'video': 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4', 'thumbnail': 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerEscapes.jpg'}])
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simplepush-2.2.5.tar.gz
(5.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simplepush-2.2.5.tar.gz.
File metadata
- Download URL: simplepush-2.2.5.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e1e34898aba343bbc38b8db9bb135e192f999b1db10ff74de40159a973ef3f6
|
|
| MD5 |
f8a794e4b4d43d44b09b76115fd82c9f
|
|
| BLAKE2b-256 |
b6d08738ba1a07c624bb7211022a9df813588620ed75716abce9715b5a304481
|
File details
Details for the file simplepush-2.2.5-py3-none-any.whl.
File metadata
- Download URL: simplepush-2.2.5-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72d4340646661ee0f06a90af86df7ea66add211cb950b0d57e42493ccb960d1e
|
|
| MD5 |
25dff5d220417297c6c59cac0e125022
|
|
| BLAKE2b-256 |
08fe1f23cd727d6dc3dceac44ffcdc69a7752a19ff177198942a3b25cb72422c
|