• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1oauth2client
2============
3
4*making OAuth2 just a little less painful*
5
6``oauth2client`` makes it easy to interact with OAuth2-protected resources,
7especially those related to Google APIs. You can also start with `general
8information about using OAuth2 with Google APIs
9<https://developers.google.com/accounts/docs/OAuth2>`_.
10
11Getting started
12---------------
13
14We recommend installing via ``pip``:
15
16.. code-block:: bash
17
18    $ pip install --upgrade oauth2client
19
20You can also install from source:
21
22.. code-block:: bash
23
24    $ git clone https://github.com/google/oauth2client
25    $ cd oauth2client
26    $ python setup.py install
27
28Using ``pypy``
29--------------
30
31-   In order to use crypto libraries (e.g. for service accounts) you will
32    need to install one of ``pycrypto`` or ``pyOpenSSL``.
33-   Using ``pycrypto`` with ``pypy`` will be in general problematic. If
34    ``libgmp`` is installed on your machine, the ``pycrypto`` install will
35    attempt to build ``_fastmath.c``. However, this file uses CPython
36    implementation details and hence can't be built in ``pypy`` (as of
37    ``pypy`` 2.6 and ``pycrypto`` 2.6.1). In order to install
38
39    .. code-block:: bash
40
41        with_gmp=no pip install --upgrade pycrypto
42
43    See discussions on the `pypy issue tracker`_ and the
44    `pycrypto issue tracker`_.
45
46-   Using ``pyOpenSSL`` with versions of ``pypy`` before 2.6 may be in general
47    problematic since ``pyOpenSSL`` depends on the ``cryptography`` library.
48    For versions of ``cryptography`` before 1.0, importing ``pyOpenSSL``
49    with it caused `massive startup costs`_. In order to address this
50    slow startup, ``cryptography`` 1.0 made some `changes`_ in how it used
51    ``cffi`` when means it can't be used on versions of ``pypy`` before 2.6.
52
53    The default version of ``pypy`` you get when installed
54
55    .. code-block:: bash
56
57        apt-get install pypy pypy-dev
58
59    on `Ubuntu 14.04`_ is 2.2.1. In order to upgrade, you'll need to use
60    the `pypy/ppa PPA`_:
61
62    .. code-block:: bash
63
64        apt-get purge pypy pypy-dev
65        add-apt-repository ppa:pypy/ppa
66        apt-get update
67        apt-get install pypy pypy-dev
68
69.. _pypy issue tracker: https://bitbucket.org/pypy/pypy/issues/997
70.. _pycrypto issue tracker: https://github.com/dlitz/pycrypto/pull/59
71.. _massive startup costs: https://github.com/pyca/pyopenssl/issues/137
72.. _changes: https://github.com/pyca/cryptography/issues/2275#issuecomment-130751514
73.. _Ubuntu 14.04: http://packages.ubuntu.com/trusty/pypy
74.. _pypy/ppa PPA: https://launchpad.net/~pypy/+archive/ubuntu/ppa
75
76Downloads
77^^^^^^^^^
78
79* `Most recent release tarball
80  <https://github.com/google/oauth2client/tarball/master>`_
81* `Most recent release zipfile
82  <https://github.com/google/oauth2client/zipball/master>`_
83* `Complete release list <https://github.com/google/oauth2client/releases>`_
84
85Library Documentation
86---------------------
87
88* Complete library index: :ref:`genindex`
89* Index of all modules: :ref:`modindex`
90* Search all documentation: :ref:`search`
91
92Contributing
93------------
94
95Please see the `contributing page`_ for more information.
96In particular, we love pull requests -- but please make sure to sign the
97contributor license agreement.
98
99.. _contributing page: https://github.com/google/oauth2client/blob/master/CONTRIBUTING.md
100
101.. toctree::
102   :maxdepth: 1
103   :hidden:
104
105   source/oauth2client
106
107Supported Python Versions
108-------------------------
109
110We support Python 2.6, 2.7, 3.3+. (Whatever this file says, the truth is
111always represented by our `tox.ini`_).
112
113.. _tox.ini: https://github.com/google/oauth2client/blob/master/tox.ini
114
115We explicitly decided to support Python 3 beginning with version
1163.3. Reasons for this include:
117
118* Encouraging use of newest versions of Python 3
119* Following the lead of prominent `open-source projects`_
120* Unicode literal support which
121  allows for a cleaner codebase that works in both Python 2 and Python 3
122
123.. _open-source projects: http://docs.python-requests.org/en/latest/
124.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/
125