{ "info": { "author": "caoyue", "author_email": "i@caoyue.me", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "oauth2py\n~~~~~~~~\n\n| |PyPI version|\n| |Build Status|\n| |Coverage Status|\n\na simple, lightweight oauth client\n\nrequire\n~~~~~~~\n\n- python 2.7+\n- python 3.3+\n\nsupported\n~~~~~~~~~\n\n- [x] Weibo\n- [x] QQ\n- [x] Facebook\n- [x] Github\n- [x] Twitter\n- [ ] Other\u2026\n\nuseage\n~~~~~~\n\n#. create client\n\n - put ``oauth2py.json`` in your app root folder\n\n .. code:: json\n\n [{\n \"name\": \"github\",\n \"client_id\": \"\",\n \"client_secret\": \"\",\n \"redirect_uri\": \"\",\n \"scope\": \"\"\n },\n {\n \"name\": \"twitter\",\n \"client_id\": \"\",\n \"client_secret\": \"\",\n \"redirect_uri\": \"\",\n \"scope\": \"\"\n }]\n\n .. code:: python\n\n from oauth2py.client import OauthClient as oauth\n\n github = oauth.load('github')\n\n - or set config in code\n\n .. code:: python\n\n github.init({\n 'client_id': '',\n 'client_secret': '',\n 'redirect_uri': '',\n 'scope': ''\n })\n\n#. oauth\n\n #. get login url\n\n .. code:: python\n\n url = github.get_login_url(state='abc')\n\n #. get user info\n\n .. code:: python\n\n user = github.get_user_info('code=12345&state=abc')\n # or\n user = github.get_user_info({'code': '12345', 'state': 'abc'})\n\n #. save access token\n\n .. code:: python\n\n token = github.get_access_token()\n # save token ...\n\n#. access resource\n\n - get github repo list\n\n .. code:: python\n\n github.set_access_token({\n 'access_token': '...'\n })\n github.access_resource(\n 'GET', 'https://api.github.com/user/repos')\n\n - another example: post status to twitter\n\n .. code:: python\n\n twitter.set_access_token({\n 'access_token': '...',\n 'access_token_secret': '...'\n }\n )\n twitter.access_resource(\n 'POST',\n url='https://api.twitter.com/1.1/statuses/update.json',\n data={\n 'status': 'test from oauth2py!'\n }\n )\n\nimplement new providers\n~~~~~~~~~~~~~~~~~~~~~~~\n\n- inherit ``oauth2py.Oauth2`` or ``oauth2py.Oauth`` and set oauth urls\n\n .. code:: python\n\n class Github(Oauth2):\n\n NAME = 'Github'\n AUTHORIZATION_URL = 'https://github.com/login/oauth/authorize'\n ACCESS_TOKEN_URL = 'https://github.com/login/oauth/access_token'\n GET_USERINFO_URL = 'https://api.github.com/user'\n\n def __init__(self):\n super(Github, self).__init__()\n\n- parse user info from response\n\n .. code:: python\n\n def parse_user_info(self, response):\n return {\n 'uid': str(response.get('id')),\n 'name': response.get('name'),\n 'avatar': response.get('avatar_url'),\n 'raw': response\n }\n\n\n.. |PyPI version| image:: https://img.shields.io/pypi/v/oauth2py.svg?style=flat\n :target: https://pypi.python.org/pypi/oauth2py\n.. |Build Status| image:: https://img.shields.io/travis/shadowsocks/shadowsocks/master.svg?style=flat\n :target: https://travis-ci.org/caoyue/oauth2py\n.. |Coverage Status| image:: https://coveralls.io/repos/github/caoyue/oauth2py/badge.svg?branch=master\n :target: https://coveralls.io/github/caoyue/oauth2py?branch=master\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/caoyue/oauth2py", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/caoyue/oauth2py", "keywords": null, "license": "http://www.apache.org/licenses/LICENSE-2.0", "maintainer": null, "maintainer_email": null, "name": "oauth2py", "package_url": "https://pypi.org/project/oauth2py/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/oauth2py/", "project_urls": { "Download": "https://github.com/caoyue/oauth2py", "Homepage": "https://github.com/caoyue/oauth2py" }, "release_url": "https://pypi.org/project/oauth2py/1.1.5/", "requires_dist": null, "requires_python": null, "summary": "a simple, lightweight oauth client", "version": "1.1.5" }, "last_serial": 2927182, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "29e969389c19c6b6f6928785808031ae", "sha256": "f7b3c9e5d3254350019d493e0a31f65188a3f41a7e491cf10c3b069ad819296b" }, "downloads": -1, "filename": "oauth2py-1.0.0.tar.gz", "has_sig": false, "md5_digest": "29e969389c19c6b6f6928785808031ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3946, "upload_time": "2016-04-20T05:33:26", "url": "https://files.pythonhosted.org/packages/dd/64/c1aa2f8c64775d6c84bacefacc6154b26c5360c2ff3adabdd079089da553/oauth2py-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "e93d739afd38febf1a6cb551a92ba690", "sha256": "37d79f5e67d805a180383cc51760ccf4f6ba03a57042e685c4659aa8fcbbfb95" }, "downloads": -1, "filename": "oauth2py-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e93d739afd38febf1a6cb551a92ba690", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4640, "upload_time": "2016-04-20T11:08:07", "url": "https://files.pythonhosted.org/packages/85/49/bbeb5852971ce48058fa45ed37d6797cfb6c7800473d5b4956550ea8b7ee/oauth2py-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "adece377961d20e7aa884e4b44893ca8", "sha256": "a38f16e1d2344f153e8b316617cc11118df9cb438c9d3f1c99a6e072cbbb14b0" }, "downloads": -1, "filename": "oauth2py-1.0.2.tar.gz", "has_sig": false, "md5_digest": "adece377961d20e7aa884e4b44893ca8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4628, "upload_time": "2016-04-20T11:17:04", "url": "https://files.pythonhosted.org/packages/53/41/3ad132db34d1bc6f80c94465c3ad2615ade8b5e6265ac48bf24ddd52f673/oauth2py-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "57c9221d9484d1746f0e89cfb190a2d7", "sha256": "905650aa8bf53c35fc9b8f851fb6fb07717bd5630408abb61441265751b34702" }, "downloads": -1, "filename": "oauth2py-1.1.0.tar.gz", "has_sig": false, "md5_digest": "57c9221d9484d1746f0e89cfb190a2d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5194, "upload_time": "2016-04-21T05:37:28", "url": "https://files.pythonhosted.org/packages/95/28/dbb9baccf0f794431df66d07741370d87862fa46da8fc1590d06b916985b/oauth2py-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "7c4efce74f18bbc32487ca816e120df1", "sha256": "0c14ebbfeed27a3ca1918048378751a2696bde85375ba34cf0afe5281f890ae1" }, "downloads": -1, "filename": "oauth2py-1.1.1.tar.gz", "has_sig": false, "md5_digest": "7c4efce74f18bbc32487ca816e120df1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5265, "upload_time": "2016-04-21T10:19:15", "url": "https://files.pythonhosted.org/packages/ec/28/4fa9861d6c216ded1ee70127e81c696bd4aae1c1cd325c5f74481eb8a4d7/oauth2py-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "fb7552066038c9d0d814794b0205b249", "sha256": "2f72f301d1bd1e3bc5a975e6c00f13513d0e669e69cbf383be6672c0d5e7931d" }, "downloads": -1, "filename": "oauth2py-1.1.2.tar.gz", "has_sig": false, "md5_digest": "fb7552066038c9d0d814794b0205b249", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5277, "upload_time": "2016-04-22T03:36:19", "url": "https://files.pythonhosted.org/packages/c2/8b/ce9cacba782244b58eb271affcb26740b823d252bc19a2eaef56312fe317/oauth2py-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "0db314a66caf57a1f79746f3feda7cc5", "sha256": "48368582ef28a2ca730cc231e29bcaec0c4a27ce741a275495120627f560c9d8" }, "downloads": -1, "filename": "oauth2py-1.1.3.tar.gz", "has_sig": false, "md5_digest": "0db314a66caf57a1f79746f3feda7cc5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5532, "upload_time": "2016-05-16T08:27:01", "url": "https://files.pythonhosted.org/packages/b7/56/567a34b1d28b3a34ccfd18e356cff0863605f7a8a81b4f0485572a58651c/oauth2py-1.1.3.tar.gz" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "ec344cc214deeba9739b7dd43756f15a", "sha256": "3d94152e960190f9292a0bef3fc306b0cf4ceb19c0f4dbd04d0773cc4610dc6a" }, "downloads": -1, "filename": "oauth2py-1.1.4.tar.gz", "has_sig": false, "md5_digest": "ec344cc214deeba9739b7dd43756f15a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5542, "upload_time": "2016-05-24T02:57:53", "url": "https://files.pythonhosted.org/packages/c7/f5/4283f4ff88ed3b5250468bb5ebc12f7ccf1f5b59cb5852d5dfe22660afac/oauth2py-1.1.4.tar.gz" } ], "1.1.5": [ { "comment_text": "", "digests": { "md5": "077b7f1b6ac1a925dcad2b8ec83b6942", "sha256": "d5653e22e025caac775e3a027f250020574f9ca35210b3c8317b235540a27626" }, "downloads": -1, "filename": "oauth2py-1.1.5.tar.gz", "has_sig": false, "md5_digest": "077b7f1b6ac1a925dcad2b8ec83b6942", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5271, "upload_time": "2017-06-05T18:12:51", "url": "https://files.pythonhosted.org/packages/09/a9/9cd902179562ad534df9f3f5c3fd8001903153ddc6f19aa8d993b55a2bc6/oauth2py-1.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "077b7f1b6ac1a925dcad2b8ec83b6942", "sha256": "d5653e22e025caac775e3a027f250020574f9ca35210b3c8317b235540a27626" }, "downloads": -1, "filename": "oauth2py-1.1.5.tar.gz", "has_sig": false, "md5_digest": "077b7f1b6ac1a925dcad2b8ec83b6942", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5271, "upload_time": "2017-06-05T18:12:51", "url": "https://files.pythonhosted.org/packages/09/a9/9cd902179562ad534df9f3f5c3fd8001903153ddc6f19aa8d993b55a2bc6/oauth2py-1.1.5.tar.gz" } ] }