{ "info": { "author": "Dominik Miedzi\u0144ski", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Internet" ], "description": "Google OAuth Service\n********************\n\n.. image:: https://img.shields.io/travis/miedzinski/google-oauth.svg\n :target: https://travis-ci.org/miedzinski/google-oauth/builds\n.. image:: https://img.shields.io/codecov/c/github/miedzinski/google-oauth.svg\n :target: https://codecov.io/github/miedzinski/google-oauth\n\n``google-oauth`` aims to implement Google OAuth2.\n\nInstallation\n============\n\nRequires Python 2.7 or 3.3+.\n\nUse ``pip``:\n\n $ pip install google-oauth\n\nOr download code rom GitHub and install it manually with ``setuptools``:\n\n $ git clone https://github.com/miedzinski/google-oauth2-service.git\n $ cd google-oauth\n $ python setup.py install\n\nIn case of ``pyOpenSSL`` build failing, install openssl headers.\nOn Debian based distributions:\n\n $ apt-get install libssl-dev\n\nUsage\n=====\n\nAt this moment, there is only `Server to Server` flow implemented.\n\nOAuth2 for service accounts\n---------------------------\n\nFirst, create ``ServiceAccount`` object. The best way to achieve this\nis using one of two classmethods:\n\n - ServiceAccount.from_json\n - ServiceAccount.from_pkcs12\n\nGoogle recommends JSON key format, so we will use it.\nBoth methods are documented in source code.\n\n >>> key = json.load(open('/path/to/credentials.json'))\n >>> auth = ServiceAccount.from_json(key=key, scopes=scope)\n >>> auth.access_token\n\nAnd that's it - OAuth2 access token is available as ``access_token`` property.\nIf you think token's lifetime will be longer than object's, you can cache it\nin file or database of your choice.\nOtherwise, you can use a ``GoogleService.authorized_request``, which is\na handy shortcut to ``requests.request`` with proper ``Authorization`` header.\nSubsequent calls to this method won't request new access tokens unless\nprevious one expired.\n\nLet's search for Guuido van Rossum on Google+\n\n >>> scope = 'https://www.googleapis.com/auth/plus.login'\n >>> url = 'https://www.googleapis.com/plus/v1/people' \\\n >>> '?query=Guuido+van+Rossum'\n >>> resp = auth.authorized_request(method='get', url=url)\n\n``resp`` is now an instance of ``requests.Response``, from which we can\nextract all the data we need.\n\nDocumentation\n=============\n\nSource code is fully documented with docstrings.\n\nTODO\n====\n\n- Implement three-legged OAuth2 (for web server applications).\n\nContributing\n============\n\nAll contributors are welcome! Make sure the tests pass and don't forget\nto write your own tests if you code new stuff.\nIf you want to submit a patch, use GitHub pull requests.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/miedzinski/google-oauth", "keywords": "google oauth oauth2 api service jwt", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "google-oauth", "package_url": "https://pypi.org/project/google-oauth/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/google-oauth/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/miedzinski/google-oauth" }, "release_url": "https://pypi.org/project/google-oauth/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "OAuth2 for Google APIs", "version": "1.0.1" }, "last_serial": 2034771, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "3eceabd50edfa0d9f223cd25c13b02ae", "sha256": "08ec0808701e43b9520510722c5b812e7bffbc5f4c2a4a19008b650e4da5ffa8" }, "downloads": -1, "filename": "google-oauth-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3eceabd50edfa0d9f223cd25c13b02ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5674, "upload_time": "2016-03-28T20:46:22", "url": "https://files.pythonhosted.org/packages/03/1a/60e91ec9c5576cd9f72626c6102785aaa6df4599cb9dc8abf4fc993ab9ac/google-oauth-1.0.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "433fd30d6e15c0e315accf9b4e3d8c21", "sha256": "5d26c0d995aafd5f4884424159146c81569b9762ed9516d9fd13c7d6c11cc5aa" }, "downloads": -1, "filename": "google-oauth-1.0.1.tar.gz", "has_sig": false, "md5_digest": "433fd30d6e15c0e315accf9b4e3d8c21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5622, "upload_time": "2016-03-28T21:01:26", "url": "https://files.pythonhosted.org/packages/f9/4d/bbf432c241095672133a4f22363c0e3937520e480f9e7bd6a3e330526c0f/google-oauth-1.0.1.tar.gz" } ], "1.0.1": [] }, "urls": [] }