This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

将百度云推送(Push)服务端的所有 API 封装成一个类 BaiduPush,通过对该类的简单初始化,即可调用其内部的各种方法,使用百度云推送服务。

BaiduPush 提供的方法和服务端 API 对应,是对服务端 REST API 的封装,详细的 REST API 请参考 官网API列表

代码构成

  • baidupush/baidupush.py – SDK 脚本,包含对外提供的所有接口
  • sample/sample.py – 使用 SDK 的 Demo 文件

依赖库

一般规则

  • 所有函数的参数和返回值中如果有中文,必须是UTF-8编码
  • 不需要对函数参数进行urlencode
  • 错误信息见 错误码定义

安装

pip install baidupush

或者

easy_install baidupush

调用方法

from baidupush import BaiduPush, BaiduPushError
apikey = "76Yi0ZBGGV2HrAziIiYEFtRh"
secretkey = "xxxxxxxxxxxxx"
user_id = "1105115563847474869"
channel_id = 3944730196422489622

message = "{'title':'baidu push','description':'message from python sdk'}"
message_key = "key1"

pusher = BaiduPush(apikey, secretkey)
push_type = BaiduPush.PUSH_TO_USER
optional = dict()
optional[BaiduPush.USER_ID] = user_id
optional[BaiduPush.CHANNEL_ID] = channel_id
optional[BaiduPush.MESSAGE_TYPE] = BaiduPush.PUSH_NOTIFICATION
try:
    ret = pusher.push_msg(push_type, message, message_key, optional)
except BaiduPushError:
    print 'Exception :', err
print ret

版本更迭

该 Python SDK 主要由 luvchh 完成了大部分的工作

第一版:

luvchh 提供

第二版:

blacklaw0 修改

第三版:

gfreezy 修改

第四版:

cheng-shiwen 更新

第五版:

sinchb 修改

Release History

Release History

0.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
baidupush-0.1.1.macosx-10.10-intel.exe (71.5 kB) Copy SHA256 Checksum SHA256 any Windows Installer Jun 12, 2015
baidupush-0.1.1.tar.gz (7.2 kB) Copy SHA256 Checksum SHA256 Source Jun 12, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting