Skip to main content

OneSignal API wrapper

Project description

OneSignal client

OneSignal client is a wrapper for the OneSignal API which allows you to send notifications to Android, iOS and Web App.

It is based on onesignal-notifications library.

Installation

pip install onesignal-client

Usage

from onesignal import OneSignalClient, 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 docs
npm install -g vuepress
vuepress dev

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

onesignal-client-0.0.1.linux-x86_64.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onesignal_client-0.0.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file onesignal-client-0.0.1.linux-x86_64.tar.gz.

File metadata

  • Download URL: onesignal-client-0.0.1.linux-x86_64.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.2

File hashes

Hashes for onesignal-client-0.0.1.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 6d8a261b2d075a116039c4e3529416318b1378ce1b1c2fed1977f5dd96b041a3
MD5 2a61bbf24449378d0176c2b27beea76a
BLAKE2b-256 ccf6da7762b089e2424c5e65415aefe00b02206799e7b7455540034054e5666c

See more details on using hashes here.

File details

Details for the file onesignal_client-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: onesignal_client-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.2

File hashes

Hashes for onesignal_client-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 892cdc13c1b48148880a8f6f902807f6625a7707cd14eaa16490b87d0826c7c0
MD5 13ff9ab1a7e9e9386597429563254883
BLAKE2b-256 4810b8606c660bb1a373469305f7e7966acdef90903fbef4e941d81033aaf9cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page