OneSignal API Wrapper for Python
Project description
OneSignal-Notifications
OneSignal-Notifications is a wrapper for the OneSignal API which allows you to send notifications to Android, iOS and Web App.
Installation
pip install onesignal-notifications
Usage
from onesignal import OneSignal, SegmentNotification
client = OneSignal("MY_APP_ID", "MY_REST_API_KEY")
notification_to_all_users = SegmentNotification(
contents={
"en": "Hello from OneSignal-Notifications"
},
included_segments=[SegmentNotification.ALL]
)
client.send(notification_to_all_users)
Development
Contributions are welcome
pip install --editable .
run the tests
export ONESIGNAL_API_KEY="..."
export ONESIGNAL_REST_API_KEY="..."
pytest
Docs
To edit the docs, change the folder and spin up the development server.
cd documentation
npm install -g vuepress
vuepress dev
When you finished editing the docs, build the files.
vuepress build
Don't forget to add the folder docs
to git.
Meta
Lucas Hild - https://lucas-hild.de
This project is licensed under the MIT License - see the LICENSE file for details
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for onesignal-notifications-0.2.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 932b616606c41cd7ae6db218d2b241f61a9de07426887f1ae5a85196f2090da7 |
|
MD5 | b1a31b6fbe50126bab73b4176b66c6a7 |
|
BLAKE2b-256 | bfa8dd0107f2826d48dbbb642aa08ae61427d7191dd83e97a70c02c80768380a |
Close
Hashes for onesignal_notifications-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52fc6d11c44894b169f74d909262627aeb12a8fb7bb8b99c5c9b5ccfd4e04ee0 |
|
MD5 | a2f4d30b7c5ab8bbc03e067ad558387a |
|
BLAKE2b-256 | 39b96b8bad1b4bae2cbeb0dffcca53156f2b4bd3b6eec47a76835c926ae66cb1 |