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
Release history Release notifications | RSS feed
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
File details
Details for the file jpush-3.3.9.tar.gz
.
File metadata
- Download URL: jpush-3.3.9.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d3692cc31754c9be23c688e65308d2956371f4d45861223126c980b28858753 |
|
MD5 | 2cce700a0a1a50e95b8f9412583ca010 |
|
BLAKE2b-256 | df20af9c26c65075058e8fa89feb0aaa0e4a00d74223af924c3a52e119881e54 |
File details
Details for the file jpush-3.3.9-py2.py3-none-any.whl
.
File metadata
- Download URL: jpush-3.3.9-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.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 087014d37eb1ff49eb12d595bc771f737e5a0d918f55d4d2cf1c63d31457e5ba |
|
MD5 | 7be011a76cd26dea809d1d57cdea569e |
|
BLAKE2b-256 | 2b98b2cd6b71a452ef09e4cb8eafc76abab237b6a999a088f5b9853bb10347e8 |