All Projects → jpush → Jpush Api Python Client

jpush / Jpush Api Python Client

JPush's officially supported Python client library for accessing JPush APIs. 极光推送官方支持的 Python 版本服务器端 SDK。

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Jpush Api Python Client

Objc Sdk
LeanCloud Objective-C SDK
Stars: ✭ 186 (-8.37%)
Mutual labels:  sdk
Pdk
The shortest path to better modules: Puppet Development Kit; Download:
Stars: ✭ 194 (-4.43%)
Mutual labels:  sdk
Phpspo
Office 365 Library for PHP. It allows to performs CRUD operations against Office 365 resources via an REST/OData based API
Stars: ✭ 198 (-2.46%)
Mutual labels:  sdk
Api 3.0 Php
SDK PHP da API 3.0 da Cielo
Stars: ✭ 189 (-6.9%)
Mutual labels:  sdk
Oci Python Sdk
Oracle Cloud Infrastructure SDK for Python
Stars: ✭ 191 (-5.91%)
Mutual labels:  sdk
Pdfxkit
A drop-in replacement for Apple PDFKit powered by our PSPDFKit framework under the hood.
Stars: ✭ 195 (-3.94%)
Mutual labels:  sdk
Msgraph Sdk Java
Microsoft Graph SDK for Java
Stars: ✭ 184 (-9.36%)
Mutual labels:  sdk
Lief
Authors
Stars: ✭ 2,730 (+1244.83%)
Mutual labels:  sdk
Js Realtime Sdk
LeanCloud Realtime Message JavaScript SDK
Stars: ✭ 193 (-4.93%)
Mutual labels:  sdk
Pay
支付 SDK 的集合与重构,支持支付宝、微信支付、银联支付。
Stars: ✭ 198 (-2.46%)
Mutual labels:  sdk
React Native Alipay
Alipay SDK for React Native. Support RN >= 0.47.
Stars: ✭ 191 (-5.91%)
Mutual labels:  sdk
Cognitive Face Ios
iOS SDK for the Microsoft Face API, part of Cognitive Services
Stars: ✭ 191 (-5.91%)
Mutual labels:  sdk
Pan Os Python
The PAN-OS SDK for Python is a package to help interact with Palo Alto Networks devices (including physical and virtualized Next-generation Firewalls and Panorama). The pan-os-python SDK is object oriented and mimics the traditional interaction with the device via the GUI or CLI/API.
Stars: ✭ 194 (-4.43%)
Mutual labels:  sdk
Hyperdash Sdk Py
Official Python SDK for Hyperdash
Stars: ✭ 190 (-6.4%)
Mutual labels:  sdk
Wechat
weixin/wechat/微信公众平台/微信企业号/微信商户平台/微信支付 go/golang sdk
Stars: ✭ 2,330 (+1047.78%)
Mutual labels:  sdk
Flamelink
JavaScript SDK for integrating with Flamelink CMS 🔥
Stars: ✭ 186 (-8.37%)
Mutual labels:  sdk
Sdk
Library for using Grafana' structures in Go programs and client for Grafana REST API.
Stars: ✭ 193 (-4.93%)
Mutual labels:  sdk
Terraform Plugin Sdk
Terraform Plugin SDK enables building plugins (providers) to manage any service providers or custom in-house solutions
Stars: ✭ 201 (-0.99%)
Mutual labels:  sdk
Instabug React Native
In-app feedback and bug reporting tool for React Native
Stars: ✭ 201 (-0.99%)
Mutual labels:  sdk
Cos Js Sdk V5
腾讯云 COS JS SDK(XML API)
Stars: ✭ 198 (-2.46%)
Mutual labels:  sdk

JPush API Python Client

概述

这是 JPush REST API 的 Python 版本封装开发包,是由极光推送官方提供的,一般支持最新的 API 功能。

对应的 REST API 文档:https://docs.jiguang.cn/jpush/server/push/server_overview/

兼容版本

  • Python 2.7
  • Python 3

环境配置

pip 方式:

sudo pip install jpush

easy_install 方式:

sudo easy_install jpush

使用源码方式:

sudo python setup.py install

代码样例

代码样例在 jpush-api-python-client 中的 examples 文件夹中,点击查看所有 examples

以下片断来自项目代码里的文件:jpush-api-python-client 中的 examples/push_examples 目录下的 example_all.py

这个样例演示了消息推送,日志设置,异常处理。

_jpush = jpush.JPush(app_key, master_secret)
push = _jpush.create_push()
# if you set the logging level to "DEBUG",it will show the debug logging.
_jpush.set_logging("DEBUG")
push.audience = jpush.all_
push.notification = jpush.notification(alert="hello python jpush api")
push.platform = jpush.all_
try:
    response=push.send()
except common.Unauthorized:
    raise common.Unauthorized("Unauthorized")
except common.APIConnectionException:
    raise common.APIConnectionException("conn error")
except common.JPushFailure:
    print ("JPushFailure")
except:
    print ("Exception")

日志说明

logging level 默认的是 WARNING ,为了方便调试建议设置为 DEBUG 设置方法为:

_jpush.set_logging("DEBUG")

异常说明

  • Unauthorized

    • AppKey,Master Secret 错误,验证失败必须改正。
  • APIConnectionException

    • 包含错误的信息:比如超时,无网络等情况。
  • JPushFailure

    • 请求出错,参考业务返回码。

HTTP 状态码

参考文档:http://docs.jiguang.cn/jpush/server/push/http_status_code/

Push v3 API 状态码 参考文档:http://docs.jiguang.cn/jpush/server/push/rest_api_v3_push/ 

Report API 状态码 参考文档:http://docs.jiguang.cn/jpush/server/push/rest_api_v3_report/

Device API 状态码 参考文档:http://docs.jiguang.cn/jpush/server/push/rest_api_v3_device/

Push Schedule API 状态码 参考文档:http://docs.jiguang.cn/jpush/server/push/rest_api_push_schedule/ 

Release页面 有详细的版本发布记录与下载。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].