Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloudaice/weixin
微信公众平台的Python包
https://github.com/cloudaice/weixin
Last synced: 3 months ago
JSON representation
微信公众平台的Python包
- Host: GitHub
- URL: https://github.com/cloudaice/weixin
- Owner: cloudaice
- License: other
- Created: 2013-05-26T10:47:28.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-26T20:56:30.000Z (over 11 years ago)
- Last Synced: 2024-07-08T09:59:49.476Z (4 months ago)
- Language: Python
- Size: 123 KB
- Stars: 37
- Watchers: 9
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
微信公众平台Python包
====================介绍
----
微信公众平台的Python SDK,为使用Python开发微信公众平台的开发者提供扩展包,目前只支持消息接口。安装方法
--------pip install weixin
Or
pip install https://github.com/cloudaice/weixin/zipball/master
Or
pip install git+git://github.com/cloudaice/weixin.git@master
使用方法
--------from weixin import Weixin
# process GET
weixinhandler = Weixin(token="your-weixin-token")
is_valid, echostr = weixinhandler.verify_request(signature='', timestamp='', nonce='', echostr='')
if is_valid:
response(echostr)# process POST
weixinhandler = Weixin(token="your-weixin-token")
params = weixinhandler.handle_request(request.body)
print params['MsgType']
print params['ToUserName']
print params['FromUserName']
....
content = "your content"
weixinhandler.text(content)
#weixinhandler.music(content)
#weixinhandler.news(content)
xml_body = weixinhandler.handle_response(ToUserName='', MsgType='', kwargs)
response(xml_body)