Skip to main content

JPush's officially supported Python client library

Project description

======================= JPush API Python Client

JPush's officially supported Python client library for accessing JPush APIs.

JPush Rest API Documents: http://docs.jpush.io/server/rest_api_v3_push/

You can download the latest release file here: https://github.com/jpush/jpush-api-python-client/releases


Installation

To install jpush-api-python-client, simply:

$ sudo pip install jpush

or alternatively install via easy_install:

$ sudo easy_install jpush

or from source:

$ sudo python setup.py install

Testing

For running the tests, you need the standard unittest module, shipped with Python.

To run jpush-api-python-client tests, simply:

$ nosetests tests/push tests/devices --verbosity=2 

Examples

You can see more examples in https://github.com/jpush/jpush-api-python-client/blob/master/examples

Simple iOS Push

>>> import jpush as jpush
>>> from conf import app_key, master_secret
>>> _jpush = jpush.JPush(app_key, master_secret)
>>> push = _jpush.create_push()
>>> push.audience = jpush.all_
>>> ios_msg = jpush.ios(alert="Hello, IOS JPush!", badge="+1", sound="a.caf", extras={'k1':'v1'})
>>> android_msg = jpush.android(alert="Hello, android msg")
>>> push.notification = jpush.notification(alert="Hello, JPush!", android=android_msg, ios=ios_msg)
>>> push.options = {"time_to_live":86400, "sendno":12345,"apns_production":True}
>>> push.platform = jpush.platform("ios")
>>> push.send()

Get taglist

>>> import jpush as jpush
>>> from conf import app_key, master_secret
>>> _jpush = jpush.JPush(app_key, master_secret)
>>> device = _jpush.create_device()
>>> device.get_taglist()

Questions

The best place to ask questions is our community site: http://community.jpush.cn/

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

jpush-3.3.8.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

jpush-3.3.8-py2.py3-none-any.whl (15.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file jpush-3.3.8.tar.gz.

File metadata

  • Download URL: jpush-3.3.8.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0

File hashes

Hashes for jpush-3.3.8.tar.gz
Algorithm Hash digest
SHA256 acce4d20a0dbf8849c8fa67faa433f3ba294772d3c5e4be57ad9eb2aea36b4c8
MD5 15e95b07c03bf095b30e0e76556c58c6
BLAKE2b-256 de4168191b14fd5bbde6ccd97dd1c319236f69378429d9cc99e7d36e6f515c18

See more details on using hashes here.

File details

Details for the file jpush-3.3.8-py2.py3-none-any.whl.

File metadata

  • Download URL: jpush-3.3.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0

File hashes

Hashes for jpush-3.3.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d82252b5ca6c9af423f9e71e0636af2d8259e0661d3307f9b9b17eb3e2599f83
MD5 616bc4a0f09f585a53799929790439e2
BLAKE2b-256 ed20e2626629dba8c4b624f6015fd46e8c8984e1ce0f1d1551fa9f62bcdf96b4

See more details on using hashes here.

Supported by

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