Python 的 OAuth 登录接口 python-oauth2

码农软件 · 软件分类 · OAuth开发包 · 2019-04-19 07:27:12

软件介绍

python-oauth2 是 Python 语言的 OAuth 2 的实现,包括客户端和服务器端。该项目经过完整的测试。

它拥有一下特点:

  • 100%单元测试覆盖。

  • 完全去掉了DataStore对象。

  • 所有的类名不再带有OAuth前缀。

  • Request类生产字典对象。

  • 不再支持Python2.3。

  • Client类是在httplib2基础上进行的扩展。

文档中的示例全用的是Twitter,包括以下内容:

  • 基本的Twitter登录。

  • 使用Django。

  • 供IMAP和SMTP使用的XOAUTH示例。

虽然示例都是基于Twitter的,但是都是OAuth2协议,用于登录国内的服务也不会是大问题。

客户端示例代码:

import oauth2 as oauth

# Create your consumer with the proper key/secret.
consumer = oauth.Consumer(key="your-twitter-consumer-key", 
    secret="your-twitter-consumer-secret")

# Request token URL for Twitter.
request_token_url = "http://twitter.com/oauth/request_token"

# Create our client.
client = oauth.Client(consumer)

# The OAuth Client request works just like httplib2 for the most part.
resp, content = client.request(request_token_url, "GET")
print resp
print content

本文地址:https://codercto.com/soft/d/3898.html

High-Performance Compilers for Parallel Computing

High-Performance Compilers for Parallel Computing

Michael Wolfe / Addison-Wesley / 1995-6-16 / USD 117.40

By the author of the classic 1989 monograph, Optimizing Supercompilers for Supercomputers, this book covers the knowledge and skills necessary to build a competitive, advanced compiler for parallel or......一起来看看 《High-Performance Compilers for Parallel Computing》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

SHA 加密
SHA 加密

SHA 加密工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具