{ "info": { "author": "alingse", "author_email": "alingse@foxmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7" ], "description": "# Usage\n\n```python\nIn [1]: from half_json.core import JSONFixer\n\nIn [2]: f = JSONFixer()\n\nIn [3]: f.fix('[{')\nOut[3]: FixResult(success=True, line='[{}]', origin=False)\n\nIn [4]: f.fix('{\"a')\nOut[4]: FixResult(success=True, line='{\"a\":null}', origin=False)\n\nIn [5]: f.fix('{\"a\":}')\nOut[5]: FixResult(success=True, line='{\"a\":null}', origin=False)\n```\n\n## \u76ee\u6807\n\nfix invalid/broken/truncated json\n\n# \u4fee\u590d\u539f\u7406\n\n1. JSONDecoderError\n2. line context\n\n## HitRatio\n\n\u6839\u636e checks \u91cc\u9762\u7684\u5de5\u5177\u6765\u8861\u91cf\u4fee\u6539\u6548\u679c\n\nABC : autogen --> broken --> check\nTSR : run test.sh show.sh ratio.sh\n\n### FixRatio\n\n\u4ec5\u5224\u65ad result.success == True\n\n```bash\n./runratio.sh fix\n```\n```\n1. 0.4269, 0.4287, 0.4303 # \u5b9e\u73b0\u5b8c 12 \u6761\u89c4\u5219\n2. 0.5037, 0.5084, 0.5077 # string \u7684 \" \u8865\u5145\u5728\u672b\u5c3e\n3. 0.5259, 0.5224, 0.5187 # Array \u9700\u8981 pos - 2\n4. 0.5433, 0.5311, 0.5381 # Array \u7ec6\u5316\u4e00\u4e0b [, \u7684\u60c5\u51b5\n5. 0.7192, 0.7216, 0.7265 # \u5927\u6539\u8fdb, FIX \u4e4b\u524d\u7684 Bug( parser \u88ab\u51b2\u6389\u4e86)\n6. 0.7732, 0.7686, 0.7701 # case: {\"a\":1 --> \u8865\u5145 }\n7. 0.60 , 0.58 # \u53bb\u6389\u4e86\u7a7a\u884c\n8. 0.6971, 0.6969, 0.6984 # \u589e\u52a0\u5904\u7406 StopIteration\n9. 0.7428, 0.7383, 0.7427 # \u589e\u52a0\u5904\u7406 half parse\n10. 0.7617, 0.7631, 0.7558 # \u7ec6\u5316\u5904\u7406 half parse\n11. 0.7608, 0.7612, 0.7650 # \u6dfb\u52a0\u4ece\u5de6\u5904\u7406\n12. 0.9817, 0.9827, 0.9819 # \u589e\u52a0\u5bf9\u5b57\u7b26\u4e32\u7684\u5904\u7406\n13. 0.8314, 0.8302, 0.8312 # \u53bb\u6389\u5bf9\u5b57\u7b26\u4e32\u7684\u989d\u5916\u5904\u7406\n14. 0.95X # \u5df2\u4e0d\u53ef\u53c2\u8003\n```\n\n### Real HitRatio\n\n\u5224\u65ad result.success == True\n\n\u5e76\u4e14\u89e3\u6790\u540e\u7684 json \u5927\u4f53\u548c\u539f\u6765\u4e00\u81f4(equal && dictdiffer)\n\n```bash\n./runratio.sh hit\n```\n```\n1. 0.5610, 0.5563, 0.5529 # origin\n2. 0.5593, 0.5532, 0.5587 # fix :} --> :null}\n```\n\n# TODO\n\n## \u76ee\u524d\u7684\u7f3a\u70b9 && \u53d1\u73b0\n\n3. \u6570\u5b57\u7684\u652f\u6301\u6bd4\u8f83\u5f31 --> -02 / 0. / .0\n4. \u8fd8\u4e0d\u652f\u6301\u5206\u652f\u56de\u6eaf --> [{]\n7. \u7a81\u7136\u60f3\u5230, \u5e94\u8be5\u53cd\u601d\u4e00\u4e0b, \u8fd9\u4e2a\u662f\u4e00\u4e2afixer, \u800c\u4e0d\u662f\u4e00\u4e2a\u5c06\u4efb\u4f55\u5b57\u7b26\u4e32\u90fd\u8f6c\u4e3a json \u7684\u4e1c\u897f\n \u5e94\u8be5\u660e\u786e JSONFixer \u7684\u80fd\u529b\u8303\u56f4, \u5bf9 runratio.sh \u4e5f\u5e94\u8be5\u6bd4\u8f83\u524d\u540e\u4e24\u4e2a\u7684 json \u76f8\u4f3c\u7a0b\u5ea6\u3002\n (\u542c\u8d77\u6765\u50cf\u65e0\u80fd\u8005\u7684\u8fa9\u767d?)\n\n1. \u8003\u8651\u5206\u652f\u56de\u6eaf\u7684\u65b9\u5f0f\u6765\u8bd5\u63a2\n2. \u89e3\u6790\u7f3a\u5931\u7684 JSON \u5e38\u91cf\n\n## BadCase\n1. 1- --> {\"1-\": null}\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/half-pie/half-json", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "jsonfixer", "package_url": "https://pypi.org/project/jsonfixer/", "platform": "", "project_url": "https://pypi.org/project/jsonfixer/", "project_urls": { "Homepage": "https://github.com/half-pie/half-json" }, "release_url": "https://pypi.org/project/jsonfixer/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "jsonfixer: fix invalid json: broken-json / truncated-json.", "version": "0.1.4" }, "last_serial": 5367316, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "53fc1a88230f025828ee7219d0230690", "sha256": "0ed57ecf882dc2792542a34d3792a0430b0c41e905df7b75fe3084ab0e6056c1" }, "downloads": -1, "filename": "jsonfixer-0.1.2.tar.gz", "has_sig": false, "md5_digest": "53fc1a88230f025828ee7219d0230690", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4953, "upload_time": "2019-06-03T13:00:33", "url": "https://files.pythonhosted.org/packages/c4/f6/915b7388acc03b80299f7f6110840b6eba6b3edc55c85f212ae67fa4e4bc/jsonfixer-0.1.2.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "142049112cd08c11221dedfce8d52b15", "sha256": "e82066d042809afb0e275b4a2c46856906292acc8f8de61114e0e41dd1c78147" }, "downloads": -1, "filename": "jsonfixer-0.1.4-py2-none-any.whl", "has_sig": false, "md5_digest": "142049112cd08c11221dedfce8d52b15", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7162, "upload_time": "2019-06-06T13:52:13", "url": "https://files.pythonhosted.org/packages/fd/6e/e40e960cc845b0b673d1ef59f0d08b6a3ff68faf4c9d5166127ac622705d/jsonfixer-0.1.4-py2-none-any.whl" } ], "0.1.4b2": [ { "comment_text": "", "digests": { "md5": "dc6766cddad3a19bdfee0151bdb55d5a", "sha256": "ca05e74f87d6d416c3e3c3f4b2d6c15594bbfaadddcdd6f5b5d2d0e01b0026f5" }, "downloads": -1, "filename": "jsonfixer-0.1.4b2.tar.gz", "has_sig": false, "md5_digest": "dc6766cddad3a19bdfee0151bdb55d5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6134, "upload_time": "2019-06-04T14:56:37", "url": "https://files.pythonhosted.org/packages/3c/c4/d941cc5c5cbbdfc58dc2228c115c68e343b461ee593a43fe1f4e27ae2ad9/jsonfixer-0.1.4b2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "142049112cd08c11221dedfce8d52b15", "sha256": "e82066d042809afb0e275b4a2c46856906292acc8f8de61114e0e41dd1c78147" }, "downloads": -1, "filename": "jsonfixer-0.1.4-py2-none-any.whl", "has_sig": false, "md5_digest": "142049112cd08c11221dedfce8d52b15", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7162, "upload_time": "2019-06-06T13:52:13", "url": "https://files.pythonhosted.org/packages/fd/6e/e40e960cc845b0b673d1ef59f0d08b6a3ff68faf4c9d5166127ac622705d/jsonfixer-0.1.4-py2-none-any.whl" } ] }