{ "info": { "author": "Rainy Chan", "author_email": "rainydew@qq.com", "bugtrack_url": null, "classifiers": [], "description": "Json_Compare\r\n============\r\n\r\nA library to compare any json string/json-like objects. Version 1.14 is\r\na quickfix version that fixes the bug of losing ignore_path parameter\r\nwhen handling json-strings.\r\n\r\nFeatures\r\n--------\r\n\r\n- Compare jsons and print the differences (what and where they are,\r\n recursion supported). Useful for interface testing.\r\n- Config whether it will ignore the order of items in a list or not,\r\n recursively.\r\n- Both python 26+ and 35+ supported.\r\n- Regular expressions supported for string to skip unconcerned keys or\r\n just to assert the format.\r\n- Compact **str** and **unicode** (or **bytes** and **str** in\r\n python3), they are considered equal. Good for non ascii coding\r\n languages.\r\n- Both **json string** (**unicode** or **binary** str) and **json\r\n object** (**dict**, **list** or **tuple**) are supported.\r\n- Support tuples, so results from pymysql.cursors.DictCursor can\r\n compare with interface response directly.\r\n- Json type legal check.\r\n- Support skipping anywhere using argument like *ignore_path=[\u201c/a/1/k\u201d,\r\n \u201c/a/1/l\u201d]*, dict keys or list indexes. Skipped fields are regarded as\r\n match.\r\n- The ignore_path list now support regular expressions too. You can use\r\n *[r\u201c^(/:raw-latex:`\\d+`/a)\u201d]* as ignore_path to skip all keys named\r\n \u201ca\u201d in *[{\u201ca\u201d: 1, \u201cb\u201d: 2}, {\u201ca\u201d: 1, \u201cb\u201d: 4}]* but still compare the\r\n value of \u201cb\u201d. (New)\r\n\r\n - Useful when compare multi records in database query result\r\n (dictionary cursor) with some fields unconcerned.\r\n\r\n- Fuzzy equal when handling floats. (New)\r\n\r\nQuickStart\r\n----------\r\n\r\ninstall\r\n\r\n.. code:: shell\r\n\r\n pip install jsoncomparedeep\r\n\r\nor update\r\n\r\n.. code:: shell\r\n\r\n pip install -U jsoncomparedeep\r\n\r\na simple example\r\n\r\n.. code:: python\r\n\r\n from json_compare import Jcompare\r\n cp=Jcompare()\r\n print(cp.compare({\"key1\":[\"v1\",\"v2\"],\"key2\":{\"key3\":1}},{\"key1\":[\"v2\",\"v1\"],\"key2\":{\"key3\":2}}))\r\n\r\nto see\r\n\r\n::\r\n\r\n a is {'key2': {'key3': 1}, 'key1': ['v1', 'v2']}\r\n b is {'key2': {'key3': 2}, 'key1': ['v2', 'v1']}\r\n ignore_list_seq = True, re_compare = True\r\n different value at /key2/key3\r\n a: 1\r\n b: 2\r\n False\r\n\r\nFor more demos and information, just install it and visit the test file\r\n**test_json_compare.py** in\r\n**Your_Python_Path/Lib/site-packages/json_compare/**\r\n\r\nSmall Hints\r\n-----------\r\n\r\n- Datetime in SQL result is not JSON serializable type, use something\r\n like **CAST(create_time as CHAR) \u2018create_time\u2019** in SQL statement to\r\n solve it.\r\n\r\nBug report\r\n----------\r\n\r\n- Issues and bugs report to rainydew@qq.com.\r\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://rainydew.blog.csdn.net/article/details/93904318", "keywords": "json comparison order unicode fuzzy", "license": "", "maintainer": "", "maintainer_email": "", "name": "jsoncomparedeep", "package_url": "https://pypi.org/project/jsoncomparedeep/", "platform": "", "project_url": "https://pypi.org/project/jsoncomparedeep/", "project_urls": { "Homepage": "https://rainydew.blog.csdn.net/article/details/93904318" }, "release_url": "https://pypi.org/project/jsoncomparedeep/1.14/", "requires_dist": null, "requires_python": "", "summary": "A recursive json comparison library that handles list orders and fuzzy types", "version": "1.14" }, "last_serial": 5701711, "releases": { "1.12": [ { "comment_text": "", "digests": { "md5": "c1abc689f422b071d1461f357ced3e45", "sha256": "b68f86a0ac87440e9c09470e97144c0767134d40b7878dfdb20b01ff1f26c176" }, "downloads": -1, "filename": "jsoncomparedeep-1.12.tar.gz", "has_sig": false, "md5_digest": "c1abc689f422b071d1461f357ced3e45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6505, "upload_time": "2019-07-14T09:00:22", "url": "https://files.pythonhosted.org/packages/79/c2/23128027ab914090b0408c9fe51bd263959b982a91224cc92c2a1f0eddb2/jsoncomparedeep-1.12.tar.gz" } ], "1.14": [ { "comment_text": "", "digests": { "md5": "e9874e220e1823a5396afab345e76c58", "sha256": "a03baa2cf0e32c8fd42712070de6bb7f83272251d69ea5b778c359d9f187da05" }, "downloads": -1, "filename": "jsoncomparedeep-1.14.tar.gz", "has_sig": false, "md5_digest": "e9874e220e1823a5396afab345e76c58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7417, "upload_time": "2019-08-19T18:31:14", "url": "https://files.pythonhosted.org/packages/48/e1/bad96fd3cf92f0be8e062b23179b0775d4468f9590372a2e6ee185fe0d6a/jsoncomparedeep-1.14.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e9874e220e1823a5396afab345e76c58", "sha256": "a03baa2cf0e32c8fd42712070de6bb7f83272251d69ea5b778c359d9f187da05" }, "downloads": -1, "filename": "jsoncomparedeep-1.14.tar.gz", "has_sig": false, "md5_digest": "e9874e220e1823a5396afab345e76c58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7417, "upload_time": "2019-08-19T18:31:14", "url": "https://files.pythonhosted.org/packages/48/e1/bad96fd3cf92f0be8e062b23179b0775d4468f9590372a2e6ee185fe0d6a/jsoncomparedeep-1.14.tar.gz" } ] }