Python 的 OAuth 库:Rauth

pleo 11年前

Rauth 是一个简单的 Python OAuth 1.0/a, OAuth 2.0, 和 Ofly 消费者库,基于 Requests 构建。

特点:

  • 支持 OAuth 1.0/a, 2.0 and Ofly
  • 常规连接初始化的服务封装
  • 认证会话对象提供 keep-alive 支持
  • 良好测试 (100% coverage)
  • Built on Requests (v1.x)

示例代码:

from rauth import OAuth1Service    # Get a real consumer key & secret from https://dev.推ter.com/apps/new  推ter = OAuth1Service(      name='推ter',      consumer_key='J8MoJG4bQ9gcmGh8H7XhMg',      consumer_secret='7WAscbSy65GmiVOvMU5EBYn5z80fhQkcFWSLMJJu4',      request_token_url='https://api.推ter.com/oauth/request_token',      access_token_url='https://api.推ter.com/oauth/access_token',      authorize_url='https://api.推ter.com/oauth/authorize',      base_url='https://api.推ter.com/1/')

项目主页:http://www.open-open.com/lib/view/home/1371963710682