{ "info": { "author": "zhangTian", "author_email": "hhczy1003@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# xjson\n-------\n\nxjson \u662f\u4e00\u4e2a\u80fd\u8ba9\u4f60\u7528xpath \u8bed\u6cd5\u6765\u89e3\u6790\u7684json\u7684\u5de5\u5177\n\n##Overview\n----------\n\n\u5728\u5904\u7406json\u7684\u65f6\u5019\uff0c\u5982\u679cjson\n\u5217\u8868\u6709\u5f88\u591a\u5143\u7d20\u7684\u8bdd\uff0c\u9700\u8981\u4e00\u4e2a\u4e2a\u8fed\u4ee3\u53bb\u5904\u7406\u3002\u7136\u800c\u5728xpath\n\u5374\u4e0d\u662f\u8fd9\u6837\u7684\uff0cxpath \u53ef\u4ee5\u628a\u8def\u5f84\u4e0b\u7684\u90fd\u63d0\u53d6\u51fa\u6765\uff0c\u8fd9\u6837\u5c31\u80fd\u628a\u63d0\u53d6\n\u53d8\u6210\u4e00\u884c\uff0c\u65b9\u4fbf\u5199\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u3002 xjson\n\u505a\u7684\u5c31\u662f\u8fd9\u4e48\u4e00\u4ef6\u4e8b\u3002\u8ba9\u4f60\u80fd\u591f\u4ee5xpath\u7684\u5f62\u5f0f\u89e3\u6790json\u3002\n\n::\n\n {\n \"success\":true,\n \"message\":\"\u64cd\u4f5c\u6210\u529f\uff01\",\n \"result\":[\n {\n \"firstCategoryList\":[\n {\n \"name\":\"\u5de5\u5177\",\n \"id\":\"2\"\n }\n ],\n \"secondCategoryList\":[\n {\n \"name\":\"\u94bb\u524a\u7c7b\u7535\u52a8\u5de5\u5177\",\n \"id\":\"142\",\n \"list\":[\n {\n \"name\":\"\u624b\u7535\u94bb\",\n \"id\":\"925\"\n },\n {\n \"name\":\"\u78c1\u5ea7\u94bb\",\n \"id\":\"928\"\n }\n ]\n },\n {\n \"name\":\"\u78e8\u524a\u7c7b\u7535\u52a8\u5de5\u5177\",\n \"id\":\"143\",\n \"list\":[\n {\n \"name\":\"\u89d2\u5411\u78e8\u5149\u673a\",\n \"id\":\"936\"\n },\n {\n \"name\":\"\u78e8\u5177\u7535\u78e8\",\n \"id\":\"937\"\n }\n ]\n }\n ]\n }\n ]\n }\n\n\u5982\u679c\u7528json\uff0c\u9700\u8981\u628a\u4e09\u7ea7\u5206\u7c7b\u63d0\u53d6\u51fa\u6765\u7684\u8bdd\uff0c\u4f60\u9700\u8981\u5199\u6210\n\n::\n\n for result in json_content[\"result\"]:\n for second_category in result[\"secondCategoryList\"]:\n for third_category in second_category[\"list\"]:\n print third_category[\"name\"]\n \n\n\u4e0d\u4ec5\u6df7\u4e71\uff0c\u800c\u4e14\u9700\u8981\u65f6\u523b\u6ce8\u610f\u5404\u5c42\u5d4c\u5957\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u800c\u5728 xjson\n\u4e2d\uff0c\u4f60\u53ea\u9700\u8981\u6309\u7167\u5c42\u6b21\u5173\u7cfb\u5199\u6210\n\n::\n\n result/secondCategoryList/list/name\n\n\u5c31\u53ef\u4ee5\u628a\u4e09\u7ea7\u5206\u7c7b\u5168\u90e8\u63d0\u53d6\u51fa\u6765\u4e86\u3002\n\u800c\u4e14\u8fd9\u6837\u505a\u7684\u8bdd\uff0c\u653e\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u901a\u8fc7\u914d\u7f6e\u6765\u63d0\u53d6json\u662f\u975e\u5e38\u65b9\u4fbf\u7684\u3002\n\nRequirements\n------------\n\n- python2.7", "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/hhczy/xjson", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "xjson", "package_url": "https://pypi.org/project/xjson/", "platform": "any", "project_url": "https://pypi.org/project/xjson/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/hhczy/xjson" }, "release_url": "https://pypi.org/project/xjson/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "allow you parse a json file with xpath syntax", "version": "0.1.5" }, "last_serial": 2475962, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "28445bc28512ee18667afc2197c2274b", "sha256": "6dc8f04b80a28bfe4c0189f01840135ac7fe65861ff41d7da15fad224589eb10" }, "downloads": -1, "filename": "xjson-0.1.zip", "has_sig": false, "md5_digest": "28445bc28512ee18667afc2197c2274b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1762, "upload_time": "2016-11-22T08:21:24", "url": "https://files.pythonhosted.org/packages/03/87/41ab8f03b7f4614460d38c7b281f641eee1055fec6da5414ed0ba26a0078/xjson-0.1.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8fae182a0586087c3d4f402495f1e404", "sha256": "e4347cf100b1954c0a59ff079e647a47b3621c87143319d5b0e12c965ebb7613" }, "downloads": -1, "filename": "xjson-0.1.1.zip", "has_sig": false, "md5_digest": "8fae182a0586087c3d4f402495f1e404", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2629, "upload_time": "2016-11-22T08:33:12", "url": "https://files.pythonhosted.org/packages/bd/d8/6d6f2c8f9da78d675f98af152e8aeaf89f433f55a2eef50c32e442a3baec/xjson-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "984d4738693fdf054454d6fbeb614cea", "sha256": "c35a1b55301c814619ded0e68a096de4e3f644e1d93c3c6c429278a3500d115a" }, "downloads": -1, "filename": "xjson-0.1.2.zip", "has_sig": false, "md5_digest": "984d4738693fdf054454d6fbeb614cea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2798, "upload_time": "2016-11-22T09:19:15", "url": "https://files.pythonhosted.org/packages/89/1f/1cb77c8ef66936aed04dcb95adcf8fce30decb6315dbd758360ecafb93b1/xjson-0.1.2.zip" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "00270151b4db83b3956334c1245712e8", "sha256": "38e8d7dd2867fd6ecac41dce71c4985c3b0dd35bb8897d4c122b58ea26bf2b9f" }, "downloads": -1, "filename": "xjson-0.1.3.zip", "has_sig": false, "md5_digest": "00270151b4db83b3956334c1245712e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4736, "upload_time": "2016-11-22T09:36:46", "url": "https://files.pythonhosted.org/packages/5f/f8/207b14ec9d04339a12f7ea3ed90baba56f5f34f1121c902b645e2e6c2166/xjson-0.1.3.zip" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "46efc8281c888fb6a7c1d6642f94f5dd", "sha256": "d048d8b05e0d590071ff6a03687aa75ea03de66112a8dc1c951b223cb74aae25" }, "downloads": -1, "filename": "xjson-0.1.4.zip", "has_sig": false, "md5_digest": "46efc8281c888fb6a7c1d6642f94f5dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5772, "upload_time": "2016-11-22T09:59:42", "url": "https://files.pythonhosted.org/packages/0f/19/99ae30f1d00baf8eb01b0f8950562b33b3c585516a117e4b8ae721776e3b/xjson-0.1.4.zip" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "c2d65ecb0d35f171fa9aa57e023a9282", "sha256": "78ce0d8a7091d811e7a4e9b4d09a60275f7ad98eb601c53b26bfe3d8476939db" }, "downloads": -1, "filename": "xjson-0.1.5.zip", "has_sig": false, "md5_digest": "c2d65ecb0d35f171fa9aa57e023a9282", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5775, "upload_time": "2016-11-22T10:03:09", "url": "https://files.pythonhosted.org/packages/a0/53/fe4b774126dec1b6ac212bc64db19d05c7ce476d71e8d0c2166a878b6bc4/xjson-0.1.5.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c2d65ecb0d35f171fa9aa57e023a9282", "sha256": "78ce0d8a7091d811e7a4e9b4d09a60275f7ad98eb601c53b26bfe3d8476939db" }, "downloads": -1, "filename": "xjson-0.1.5.zip", "has_sig": false, "md5_digest": "c2d65ecb0d35f171fa9aa57e023a9282", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5775, "upload_time": "2016-11-22T10:03:09", "url": "https://files.pythonhosted.org/packages/a0/53/fe4b774126dec1b6ac212bc64db19d05c7ce476d71e8d0c2166a878b6bc4/xjson-0.1.5.zip" } ] }