{ "info": { "author": "Sin", "author_email": "sin.zou@mindao.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Bottle", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "api_python\n==========\n\nFor Python\n\nInstall:\n========\n\u53ef\u4ee5\u901a\u8fc7 pip \u5b89\u88c5\uff1a\n\n\tpip install mingdao\n\n\u6216\u4e0b\u8f7d\u540e\u6267\u884c\n\n\tpython setup.py install\n\n\u8fdb\u884c\u5b89\u88c5\n\n\u4f9d\u8d56 requests \u5e93, \u5982\u679c\u9700\u8981\u76f4\u63a5\u8fd0\u884c demo, \u8fd8\u9700\u8981 bottle \u5e93, \u53ef\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u5b89\u88c5\u4f9d\u8d56\n\n\tpip install requests\n\tpip install bottle\n\nDemo:\n=====\n\u5b89\u88c5\u5b8c\u6210\u540e\u53ef\u4ee5\u901a\u8fc7\n\n\tpython -m mingdao\n\n\u8fd0\u884c demo\uff0c\u8bbf\u95ee\u5730\u5740\u4e3a http://localhost:8000\n\nUsage:\n======\n\u8bf7\u5148\u5728 http://open.mingdao.com \u6ce8\u518c\u4e00\u4e2a\u5e94\u7528\uff0c\u5e76\u83b7\u53d6 app_key \u548c app_secret\n\n## Config\n\n\timport mingdao\n\tapi = mingdao.API({\n\t\t'app_key': \u4f60\u7684 app_key(\u5fc5\u586b),\n\t\t'app_secret': \u4f60\u7684 app_secret(\u5fc5\u586b),\n\t\t'redirect_uri': \u4f60\u8bbe\u7f6e\u7684\u5e94\u7528\u56de\u8c03\u5730\u5740(\u5fc5\u586b),\n\t\t'throw_api_error': \u5728 API \u8fd4\u56de\u9519\u8bef\u7801\u65f6\u662f\u5426\u629b\u51fa\u5f02\u5e38(\u53ef\u9009),\n\t\t})\n\n## Authorize\n\u591a\u6570 API \u9700\u9996\u5148\u8fdb\u884c\u6388\u6743\uff0c\u83b7\u5f97 access_token\n\u8be6\u60c5\u8bf7\u53c2\u9605[\u660e\u9053\u5f00\u53d1\u6307\u5357](http://open.mingdao.com/Home_document_intro.html)\uff1a\n\u7528\u6237\u767b\u5f55\u540e\u4f1a\u56de\u8c03\u5e94\u7528\u7684\u56de\u8c03\u5730\u5740\uff0c\u5e76\u4f20\u9012\u4e00\u4e2a code \u53c2\u6570\uff0c\u53ef\u7528 api.authorize \u65b9\u6cd5\u8fdb\u884c\u6388\u6743\uff1a\n\n\tapi.authorize(code)\n\n\u67e5\u770b\u6388\u6743\u8fc7\u671f\u65f6\u95f4\uff1a\n\n\tapi.expires_in # \u6388\u6743\u6709\u6548\u671f\n\tapi.expires_at # \u8fc7\u671f\u65f6\u95f4\n\n\u5237\u65b0\u6388\u6743\uff1a\n\n\tapi.refresh()\n\n## Call API\n\u53ef\u901a\u8fc7 `api.\u5206\u7c7b\u540d.\u63a5\u53e3\u540d(\u53c2\u6570)` \u65b9\u5f0f\u8c03\u7528 API\uff0caccess_token, app_key, app_secret \u4ee5\u53ca format \u53c2\u6570\u65e0\u9700\u6307\u5b9a\u3002\n\u4ee5\u52a8\u6001\u66f4\u65b0\u63a5\u53e3 `/post/followed` \u4e3a\u4f8b\uff1a\n\n\tresult = api.post.followed({\n\t\t'keywords': '\u5173\u952e\u5b57',\n\t\t'post_type': 1,\n\t\t'pagesize': 50,\n\t\t})\n\nresult \u4e3a\u53cd\u5e8f\u5217\u5316 API \u63a5\u53e3\u8fd4\u56de\u7684 JSON \u5b57\u7b26\u4e32\u540e\u751f\u6210\u7684\u5b57\u5178\u5bf9\u8c61\u3002\nAPI \u63a5\u53e3\u8be6\u60c5\u8bf7\u53c2\u9605[\u660e\u9053\u5f00\u53d1\u6587\u6863](http://open.mingdao.com/Home_document_intro.htm)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/ipy/api_python", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "mingdao", "package_url": "https://pypi.org/project/mingdao/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mingdao/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/ipy/api_python" }, "release_url": "https://pypi.org/project/mingdao/0.1.4/", "requires_dist": null, "requires_python": null, "summary": "Python SDK for mingdao.com, provides Mingdao OAuth2 authorization and API wrapper.", "version": "0.1.4" }, "last_serial": 1072952, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "e36a5e28336bba5fb4937cc05868ead4", "sha256": "6508bf5d2a9c7bb381438d4cf6e2334ea29541ad38bb2f9ae454200e09d1aa7d" }, "downloads": -1, "filename": "mingdao-0.1.zip", "has_sig": false, "md5_digest": "e36a5e28336bba5fb4937cc05868ead4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4040, "upload_time": "2014-04-26T17:03:17", "url": "https://files.pythonhosted.org/packages/51/84/8592cd05351c05b60e56b1e33963f7bbd9434b44d472bad443f6c3f25686/mingdao-0.1.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c258f709b20999473a9eee58941fed52", "sha256": "08f0f4170c8f04cf930039736e3d8bf64c71054976605b8e0b92b9b9465742db" }, "downloads": -1, "filename": "mingdao-0.1.1.zip", "has_sig": false, "md5_digest": "c258f709b20999473a9eee58941fed52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3929, "upload_time": "2014-04-26T17:21:18", "url": "https://files.pythonhosted.org/packages/df/25/1717cc05cc6a1b63631655500a4bc2ec9ea53826e0fb3bd553ac35ce6e26/mingdao-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "363789ec897a607407849a7012957b86", "sha256": "3ba19b89674c4631e638308efbed49ef8d9eddc0f27d3520a2f54e2ed04116c1" }, "downloads": -1, "filename": "mingdao-0.1.2.zip", "has_sig": false, "md5_digest": "363789ec897a607407849a7012957b86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4131, "upload_time": "2014-04-26T17:34:35", "url": "https://files.pythonhosted.org/packages/ca/8d/410f6c1f3e7ff4ff37b34ddce4470b9c659edbf8d9f262bd4576aecc5500/mingdao-0.1.2.zip" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "d6f91703cedba6c3f1734b65aebe70ed", "sha256": "15e4677a37d72d75fa3c17b5a564e8d62e8970fa41f41794ad4b8623c132e5c0" }, "downloads": -1, "filename": "mingdao-0.1.3.zip", "has_sig": false, "md5_digest": "d6f91703cedba6c3f1734b65aebe70ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19437, "upload_time": "2014-04-27T01:19:20", "url": "https://files.pythonhosted.org/packages/62/1a/ca51780114e368faea7873949b8e975c52bbd3e7418b92ffd8b41c0dc119/mingdao-0.1.3.zip" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "3aef07a91819118c6227207349893d48", "sha256": "0b9cc4a458753ae0aad64690e1d95d2bd19d22720a904f0744c908c74aff8810" }, "downloads": -1, "filename": "mingdao-0.1.4.zip", "has_sig": false, "md5_digest": "3aef07a91819118c6227207349893d48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19457, "upload_time": "2014-04-27T03:12:37", "url": "https://files.pythonhosted.org/packages/56/30/fce715ef627679771e440e8eb06f952c51e3d8594ba49fced16eb44d3661/mingdao-0.1.4.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3aef07a91819118c6227207349893d48", "sha256": "0b9cc4a458753ae0aad64690e1d95d2bd19d22720a904f0744c908c74aff8810" }, "downloads": -1, "filename": "mingdao-0.1.4.zip", "has_sig": false, "md5_digest": "3aef07a91819118c6227207349893d48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19457, "upload_time": "2014-04-27T03:12:37", "url": "https://files.pythonhosted.org/packages/56/30/fce715ef627679771e440e8eb06f952c51e3d8594ba49fced16eb44d3661/mingdao-0.1.4.zip" } ] }