All Projects → mozillazg → python-shanbay

mozillazg / python-shanbay

Licence: MIT license
提供一系列操作扇贝网 (www.shanbay.com) 的 API(不再维护)

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to python-shanbay

shanbay-alfred2
扇贝词典 alfred2/3/4 workflow, 支持查询和添加单词到自己词库。update:由于扇贝关闭开放 API,本项目已经不可正常工作。
Stars: ✭ 68 (+58.14%)
Mutual labels:  shanbay
SmartReview
💠 单词智能复习项目 - 艾宾浩斯遗忘曲线 + 混淆词
Stars: ✭ 43 (+0%)
Mutual labels:  shanbay

python-shanbay

提供一系列操纵扇贝网 (www.shanbay.com) 的 API 。

Build PyPI version

Features

  • send/reply message
  • manage team
  • support shanbay api v1

Installation

To install python-shanbay, simply:

$ pip install shanbay

Basic Usage

OAuth2 认证 API(可以通过 这个脚本 获取 token)

   >>> from shanbay import API
   >>> token = {
   "access_token": "7ANNoQFY02rJkqqm8Zi67aQ9N6ES8G",
   "expires_in": "1592000", "expires_at": 1328664099.868803,
   "token_type": "Bearer", "state": "H3rTN84NG2TdunSt9bG02acEkSNWiW",
   "scope": [ "read", "write" ]
   }
   >>>
   >>> api = API('client_id_xxyyyx', token)
   >>> api.user()
   {u'avatar': u'http://qstatic.shanbay.com/avatar/media_store/3034aee41d32d464aac362cf608cb735.png?imageView/1/w/80/h/80/',
u'id': 1279912,
   u'nickname': u'\u266b mozillazg',
   u'username': u'mozillazg'}
   >>>

用户名密码认证 API(不支持 REST API)

>>> from shanbay import Shanbay, Message
>>> shanbay = Shanbay('username', 'password')
>>> shanbay.login()
True
>>> message = Message(shanbay)
>>> message.send_message(['mozillazg'], 'hello', 'hello')
True

使用案例

已知以下项目使用了本模块, 欢迎添加你的项目 ;)

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].