• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

docs/H12-Jul-2016-1,9471,316

requests_oauthlib/H12-Jul-2016-1,068861

requests_oauthlib.egg-info/H03-May-2022-162132

tests/H03-May-2022-986808

AUTHORS.rstH A D16-Oct-2014701 2520

HISTORY.rstH A D12-Jul-20163.4 KiB8270

LICENSEH A D12-Jul-2016745 1612

MANIFEST.inH A D09-Nov-2015103 54

PKG-INFOH A D12-Jul-20167.8 KiB162132

README.rstH A D18-Nov-20152.5 KiB5943

setup.cfgH A D12-Jul-201688 96

setup.pyH A D19-Feb-20161.9 KiB7153

README.rst

1Requests-OAuthlib |build-status| |coverage-status| |docs|
2=========================================================
3
4This project provides first-class OAuth library support for `Requests <http://python-requests.org>`_.
5
6The OAuth 1 workflow
7--------------------
8
9OAuth 1 can seem overly complicated and it sure has its quirks. Luckily,
10requests_oauthlib hides most of these and let you focus at the task at hand.
11
12Accessing protected resources using requests_oauthlib is as simple as:
13
14.. code-block:: pycon
15
16    >>> from requests_oauthlib import OAuth1Session
17    >>> twitter = OAuth1Session('client_key',
18                                client_secret='client_secret',
19                                resource_owner_key='resource_owner_key',
20                                resource_owner_secret='resource_owner_secret')
21    >>> url = 'https://api.twitter.com/1/account/settings.json'
22    >>> r = twitter.get(url)
23
24Before accessing resources you will need to obtain a few credentials from your
25provider (i.e. Twitter) and authorization from the user for whom you wish to
26retrieve resources for. You can read all about this in the full
27`OAuth 1 workflow guide on RTD <http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html>`_.
28
29The OAuth 2 workflow
30--------------------
31
32OAuth 2 is generally simpler than OAuth 1 but comes in more flavours. The most
33common being the Authorization Code Grant, also known as the WebApplication
34flow.
35
36Fetching a protected resource after obtaining an access token can be extremely
37simple. However, before accessing resources you will need to obtain a few
38credentials from your provider (i.e. Google) and authorization from the user
39for whom you wish to retrieve resources for. You can read all about this in the
40full `OAuth 2 workflow guide on RTD <http://requests-oauthlib.readthedocs.org/en/latest/oauth2_workflow.html>`_.
41
42Installation
43-------------
44
45To install requests and requests_oauthlib you can use pip:
46
47.. code-block:: bash
48
49    $ pip install requests requests_oauthlib
50
51.. |build-status| image:: https://travis-ci.org/requests/requests-oauthlib.svg?branch=master
52   :target: https://travis-ci.org/requests/requests-oauthlib
53.. |coverage-status| image:: https://img.shields.io/coveralls/requests/requests-oauthlib.svg
54   :target: https://coveralls.io/r/requests/requests-oauthlib
55.. |docs| image:: https://readthedocs.org/projects/requests-oauthlib/badge/?version=latest
56   :alt: Documentation Status
57   :scale: 100%
58   :target: https://readthedocs.org/projects/requests-oauthlib/
59