Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
docs/ | H | 12-Jul-2016 | - | 1,947 | 1,316 | |
requests_oauthlib/ | H | 12-Jul-2016 | - | 1,068 | 861 | |
requests_oauthlib.egg-info/ | H | 03-May-2022 | - | 162 | 132 | |
tests/ | H | 03-May-2022 | - | 986 | 808 | |
AUTHORS.rst | H A D | 16-Oct-2014 | 701 | 25 | 20 | |
HISTORY.rst | H A D | 12-Jul-2016 | 3.4 KiB | 82 | 70 | |
LICENSE | H A D | 12-Jul-2016 | 745 | 16 | 12 | |
MANIFEST.in | H A D | 09-Nov-2015 | 103 | 5 | 4 | |
PKG-INFO | H A D | 12-Jul-2016 | 7.8 KiB | 162 | 132 | |
README.rst | H A D | 18-Nov-2015 | 2.5 KiB | 59 | 43 | |
setup.cfg | H A D | 12-Jul-2016 | 88 | 9 | 6 | |
setup.py | H A D | 19-Feb-2016 | 1.9 KiB | 71 | 53 |
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