{ "info": { "author": "liluo", "author_email": "i@liluo.org", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=========\npy-oauth2\n=========\n\nA Python wrapper for the OAuth 2.0 specification\n\nInstallation\n------------\n\npip::\n \n pip install py-oauth2\n\n\neasy_install::\n\n easy_install py-oauth2\n\n\nUsage Examples\n--------------\n\nDemo for Google\n---------------\nGet user info::\n\n from pyoauth2 import Client\n\n CLIENT_ID = ''\n CLIENT_SECRET = ''\n REDIRECT_URL = ''\n SCOPE = 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email'\n\n client = Client(CLIENT_ID, CLIENT_SECRET,\n site='https://www.googleapis.com/oauth2/v1',\n authorize_url='https://accounts.google.com/o/oauth2/auth',\n token_url='https://accounts.google.com/o/oauth2/token')\n\n print '-' * 80\n authorize_url = client.auth_code.authorize_url(redirect_uri=REDIRECT_URL, scope=SCOPE)\n print 'Go to the following link in your browser:'\n print authorize_url\n\n code = raw_input('Enter the verification code and hit ENTER when you\\'re done:')\n code = code.strip()\n access_token = client.auth_code.get_token(code, redirect_uri=REDIRECT_URL)\n print 'token', access_token.headers\n\n print '-' * 80\n print 'get user info' \n ret = access_token.get('/userinfo')\n print ret.parsed\n\n\nDemo for Douban\n---------------\nGet access_token::\n\n from pyoauth2 import Client\n\n KEY = ''\n SECRET = ''\n CALLBACK = ''\n\n client = Client(KEY, SECRET, \n site='https://api.douban.com', \n authorize_url='https://www.douban.com/service/auth2/auth',\n token_url='https://www.douban.com/service/auth2/token')\n\n authorize_url = client.auth_code.authorize_url(redirect_uri=CALLBACK, scope='shuo_basic_w,douban_basic_common')\n\n access_token = client.auth_code.get_token(code, redirect_uri=CALLBACK)\n\n\nGet data::\n\n ret = access_token.get('/v2/user/~me')\n print ret.parsed\n\nUpload image::\n\n ret = access_token.post('/shuo/v2/statuses/', text='content from py-oauth2', files={ 'image': open('/path/pic.jpg')})\n print ret.parsed\n\n\nMore:\n\n`Examples `_\n\n`Demo for Google `_\n\n`Demo for Douban(auth with code) `_\n\n`Demo for Douban(auth with token) `_\n\n`Demo for Douban(auth with password) `_\n\n`Demo for GitHub `_\n\n`Demo for Weibo `_\n\n`Demo for QQ `_\n\n`Demo for Taobao `_\n\n`Demo for Box.com `_\n\n`Demo for Instagram `_\n\nSubmitting a Pull Request\n-------------------------\n* Fork the repository.\n* Create a topic branch.\n* Implement your feature or bug fix.\n* Add, commit, and push your changes.\n* Submit a pull request.", "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/liluo/py-oauth2", "keywords": "Python,pyoauth2,OAuth2,Douban,GitHub,Weibo", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "py-oauth2", "package_url": "https://pypi.org/project/py-oauth2/", "platform": "any", "project_url": "https://pypi.org/project/py-oauth2/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/liluo/py-oauth2" }, "release_url": "https://pypi.org/project/py-oauth2/0.0.10/", "requires_dist": null, "requires_python": null, "summary": "A Python wrapper for the OAuth 2.0 specification.", "version": "0.0.10" }, "last_serial": 1185467, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "fe7b69910e5730b4a17c57cf7797ac1d", "sha256": "3e968223bf109a083517bd9d05304c76d4312f684d53aab50624ceb240015455" }, "downloads": -1, "filename": "py_oauth2-0.0.1-py2.6.egg", "has_sig": false, "md5_digest": "fe7b69910e5730b4a17c57cf7797ac1d", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 12166, "upload_time": "2012-08-09T19:17:12", "url": "https://files.pythonhosted.org/packages/90/b3/c64a0b5181d593ffd1710b296981d99fb4bb3d88f976fd2a3208c1b953a9/py_oauth2-0.0.1-py2.6.egg" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "8b6875c1ab9c01fc9bc8fc5525d82452", "sha256": "9a5a12a38f98afca008f81ca412125d576d053cd73f2d61b574be8a65309f515" }, "downloads": -1, "filename": "py-oauth2-0.0.10.tar.gz", "has_sig": false, "md5_digest": "8b6875c1ab9c01fc9bc8fc5525d82452", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5357, "upload_time": "2014-08-10T09:37:10", "url": "https://files.pythonhosted.org/packages/93/fe/2a44efad2c7a65eac33c1b559bb2b3e3883ee629d05af55221aa00c4a0bd/py-oauth2-0.0.10.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "639e8f4aad77e23806749afc0248bd0b", "sha256": "35e5a3182acb40a7518a860fcbd6e133de8e9118bea16584e4a114b6f91cd5b4" }, "downloads": -1, "filename": "py_oauth2-0.0.2-py2.6.egg", "has_sig": false, "md5_digest": "639e8f4aad77e23806749afc0248bd0b", "packagetype": "bdist_egg", "python_version": "any", "requires_python": null, "size": 16927, "upload_time": "2012-08-11T17:27:50", "url": "https://files.pythonhosted.org/packages/d9/94/19fa054b0c46d5e9b896bd61070d455e217dc998058fbc1055c2c2e34736/py_oauth2-0.0.2-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "42ab5fc5f77b6a5de144ee0de70b02c9", "sha256": "46d9d2fe4680a47ab2481658891b8bf7d457c8d953e647e9b8a9cc3aea194e42" }, "downloads": -1, "filename": "py_oauth2-0.0.2-py2.7.egg", "has_sig": false, "md5_digest": "42ab5fc5f77b6a5de144ee0de70b02c9", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 17418, "upload_time": "2012-08-12T05:35:01", "url": "https://files.pythonhosted.org/packages/8d/a5/7f0ecb61117fd09778f1e42f07606a9c5d1a619fcf1d489786f3733e0a25/py_oauth2-0.0.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "65aaa6cbc115967a9f8ec5663b0f7853", "sha256": "4dafd556e237cffe059fd4b39f80537bf5681a930a4b8524c58656d91960266d" }, "downloads": -1, "filename": "py-oauth2-0.0.2.tar.gz", "has_sig": false, "md5_digest": "65aaa6cbc115967a9f8ec5663b0f7853", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4638, "upload_time": "2012-08-11T17:46:26", "url": "https://files.pythonhosted.org/packages/8c/29/73cd35be761dd2a7bc4125da04e5ca82bf8d1693faf41674cfea3d25f47b/py-oauth2-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "50d5a286858422f5dcee08c02801ddb8", "sha256": "f24fcb0aeb577439878576f01cf94f899750ebae3e5492656d5a742a806c7712" }, "downloads": -1, "filename": "py_oauth2-0.0.3-py2.7.egg", "has_sig": false, "md5_digest": "50d5a286858422f5dcee08c02801ddb8", "packagetype": "bdist_egg", "python_version": "any", "requires_python": null, "size": 17728, "upload_time": "2012-08-30T07:20:56", "url": "https://files.pythonhosted.org/packages/5c/c0/7059f75a10d30146ff72143aafd25f68cf7e59b89a309be505d2b1e128b7/py_oauth2-0.0.3-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "cfbef3c84840b999548db4de1216823d", "sha256": "728638eb991e70325a3fb4f238c780fea89a7f4149eba4bc1b8b753784e66552" }, "downloads": -1, "filename": "py-oauth2-0.0.3.tar.gz", "has_sig": false, "md5_digest": "cfbef3c84840b999548db4de1216823d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5857, "upload_time": "2012-08-30T07:20:42", "url": "https://files.pythonhosted.org/packages/48/6d/a64ec312408b0d01a6f1cd0687b218fe79ec443c253f47233713be014af4/py-oauth2-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "dd9c9d3c14c725c49a72626982cec464", "sha256": "41c3c3efbb91e371dd6ea72394f98062be180a6ab25f0b83831c145e4b84fb81" }, "downloads": -1, "filename": "py_oauth2-0.0.4-py2.7.egg", "has_sig": false, "md5_digest": "dd9c9d3c14c725c49a72626982cec464", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 17905, "upload_time": "2012-10-16T14:07:32", "url": "https://files.pythonhosted.org/packages/97/5b/7f5ab131018cb235a4171b08e2b749fb4868b522364bd2518eafe2eda575/py_oauth2-0.0.4-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "9093304337da759385e4bf392c96bc42", "sha256": "01b5df5d6dc607d29561f71b8fe1367827c45bec7417ba88bfacc237d1fbd9ea" }, "downloads": -1, "filename": "py-oauth2-0.0.4.tar.gz", "has_sig": false, "md5_digest": "9093304337da759385e4bf392c96bc42", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5945, "upload_time": "2012-10-16T14:07:25", "url": "https://files.pythonhosted.org/packages/a9/74/25b6d6e317d075e3d386271e82a389915bf73b1bf9162a3477695edb81a8/py-oauth2-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "f48afcabc50ddc4e83319b892619c45e", "sha256": "d0898361844ffbc0129a23ab59ead6048ea35ba95291da4a2956a4b037811fc5" }, "downloads": -1, "filename": "py_oauth2-0.0.5-py2.7.egg", "has_sig": false, "md5_digest": "f48afcabc50ddc4e83319b892619c45e", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 33788, "upload_time": "2012-10-23T02:52:44", "url": "https://files.pythonhosted.org/packages/a2/f4/0d3a4a0a8534cbd3c07fda06b258489b040fac960779731a3bcaa8be8d12/py_oauth2-0.0.5-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "54827be513e61bc94d3d0e832a9d1558", "sha256": "47767201eed1ff04143d4770681eaa43779556dd59735d32086d90d96f2c8262" }, "downloads": -1, "filename": "py-oauth2-0.0.5.tar.gz", "has_sig": false, "md5_digest": "54827be513e61bc94d3d0e832a9d1558", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6081, "upload_time": "2012-10-23T02:52:42", "url": "https://files.pythonhosted.org/packages/f3/5f/3090a03c2c57d4caf80e17324fe175fb3b5d0a62df0f1f91423f743b958b/py-oauth2-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "0bd8a863ffb15a15ac71b0565782a226", "sha256": "7983d762ad2ee1f830c21ab0680c08ffabf0a142d7fbd68155848938b8285d13" }, "downloads": -1, "filename": "py_oauth2-0.0.6-py2.7.egg", "has_sig": false, "md5_digest": "0bd8a863ffb15a15ac71b0565782a226", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 18342, "upload_time": "2012-11-26T15:28:52", "url": "https://files.pythonhosted.org/packages/eb/5e/9fdade4e3b052d5f3f1e0e6a0601f9e1a9f5600efbf6383e8c1fae31477d/py_oauth2-0.0.6-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "1477c0463fc24c08ff591c06a9bf3cd0", "sha256": "1b14810e01435d348d8f7892056a75fbd3578876fc392674ba62264c06702bf0" }, "downloads": -1, "filename": "py-oauth2-0.0.6.tar.gz", "has_sig": false, "md5_digest": "1477c0463fc24c08ff591c06a9bf3cd0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6150, "upload_time": "2012-11-26T15:28:50", "url": "https://files.pythonhosted.org/packages/49/d3/76b459ed305aaec2e4b333f9bf4cfc834628e96b8e1b73e2d19de5ce4c4a/py-oauth2-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "a51403bfbb09c91e7238c9775fdf90c2", "sha256": "71b911911f0cf3491a8e3a62e03289377041d109c41b45235626733f5cb89694" }, "downloads": -1, "filename": "py_oauth2-0.0.7-py2.7.egg", "has_sig": false, "md5_digest": "a51403bfbb09c91e7238c9775fdf90c2", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 18686, "upload_time": "2013-10-09T05:05:14", "url": "https://files.pythonhosted.org/packages/b4/c6/1e48cf468544b4825eaad0e6af166c20d4e57ef5bab74a1a9efb2697f317/py_oauth2-0.0.7-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "78ed4410a25fc73764b496851161b166", "sha256": "328a06a0cf59a1f36ca9a2d9744dad3dd7693951fc19a627d6e10c2ed4065c39" }, "downloads": -1, "filename": "py-oauth2-0.0.7.tar.gz", "has_sig": false, "md5_digest": "78ed4410a25fc73764b496851161b166", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6278, "upload_time": "2013-10-09T05:05:18", "url": "https://files.pythonhosted.org/packages/ea/18/81074ce18d2ac3d93e0a3f51be9a1d7a83e7f8203479afe8a303a227aeb6/py-oauth2-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "630fd7058aa545563384b5c88c9dba00", "sha256": "f9c15430f258ccd781f289fdfea20b24de63add60c57d58bdafaeb7769746294" }, "downloads": -1, "filename": "py_oauth2-0.0.8-py2.7.egg", "has_sig": false, "md5_digest": "630fd7058aa545563384b5c88c9dba00", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 15059, "upload_time": "2013-12-17T15:20:36", "url": "https://files.pythonhosted.org/packages/7d/4f/4b7f7b521c9f74d206d4f15c6e7b28cd6138b91ae6890e3b3bd8d636a395/py_oauth2-0.0.8-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "c3c54f7271c0eeb78cfe002be39e8708", "sha256": "78fe5ea3c0224ef3417b70a0cf165bf63687aaa2cbbfc3fb4e5276dce8f32eea" }, "downloads": -1, "filename": "py-oauth2-0.0.8.tar.gz", "has_sig": false, "md5_digest": "c3c54f7271c0eeb78cfe002be39e8708", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5112, "upload_time": "2013-12-17T15:20:33", "url": "https://files.pythonhosted.org/packages/eb/64/1d7003f82b8c2b4e9393017137b2e6fc546a8db0de6825a6bfeefb99be51/py-oauth2-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "0f0708857b1e5fff8624e6cf06b94ac5", "sha256": "85b53c11a5d5c8c1a945ff5b824354748b58d184e745ea25e02f291aaa738577" }, "downloads": -1, "filename": "py-oauth2-0.0.9.tar.gz", "has_sig": false, "md5_digest": "0f0708857b1e5fff8624e6cf06b94ac5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5109, "upload_time": "2014-05-11T06:35:38", "url": "https://files.pythonhosted.org/packages/80/f2/7b82f1061eba42dc67cd58d8caa986e6f6f3923d9cac68d7637480892da7/py-oauth2-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8b6875c1ab9c01fc9bc8fc5525d82452", "sha256": "9a5a12a38f98afca008f81ca412125d576d053cd73f2d61b574be8a65309f515" }, "downloads": -1, "filename": "py-oauth2-0.0.10.tar.gz", "has_sig": false, "md5_digest": "8b6875c1ab9c01fc9bc8fc5525d82452", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5357, "upload_time": "2014-08-10T09:37:10", "url": "https://files.pythonhosted.org/packages/93/fe/2a44efad2c7a65eac33c1b559bb2b3e3883ee629d05af55221aa00c4a0bd/py-oauth2-0.0.10.tar.gz" } ] }