{
"info": {
"author": "mmoosstt",
"author_email": "diponaut@gmx.de",
"bugtrack_url": null,
"classifiers": [],
"description": "# diffx #\n\nThis library was designed to compare two *.xml or *.json files. The main focus was to produce a intuitive interpretable *.svg output file. In future there will be a text export available, too. \n\ndiffx was inspired by [X-Diff](http://www.inf.unibz.it/~nutt/Teaching/XMLDM1112/XMLDM1112Coursework/WangEtAl-ICDE2003.pdf \"X-Diff: An Effective Change Detection Algorithm for XML Documents\").\n\nSince version 0.3.2 the distance cost's algorithm is replaced by parent-identification. This might by a wrong decision but the result's for huge xml documents (see. test 9) improved in performance and quality. \n\nThis is not a bullet prove library (till now). It s more a playground to get in touch with comparing tree structures and presenting the resulting in a charming way.\n\n## dependencies ##\n * PySide2\n * svgwrite\n * lxml\n * dicttoxml\n\n## installation ##\n\n```\npython pip diffx\n```\n\n## fist step ##\n\n### xml file example ###\n```\nfrom diffx import main\n\n_xml1 = './simple/xml1.xml'\n_xml2 = './simple/xml2.xml'\n\nmain.compare_xml(_xml1, _xml2)\nmain.save('./simple/diffx_file.svg')\n\n```\n\n### xml string example ###\n```\nfrom diffx import main\n\n_xml1 = \"\"\"with content\"\"\"\n_xml2 = \"\"\"\"\"\"\n\nmain.compare_xml(_xml1, _xml2)\nmain.save('./simple/diffx_string.svg')\n\n```\n\n### json file example ###\n```\nfrom diffx import main\n\njson1 = './simple/xml1.json'\njson2 = './simple/xml2.json'\n\nmain.compare_json(json1, json2)\nmain.save('./simple/diffx_file.svg')\n\n```\n\n# status quo #\n\n\n\n# implementation #\n\n Each xml element is identified by it's xpath and a hash calculated by selecting relevant information. Start with the identification of huge xml blocks (changed/moved). Identification of parent elements by tag, text-pre, text-post, attribute-names and attribute-values. Parent xml blocks can contain further parent xml blocks.\n\n```\n \n text-pre \n \t<... children ...>\n text-post\n \n```\n\n 1. mark all xml elements as changed\n 1. iterate over parent blocks, starting with maximum children to parent blocks with less children\n 1. mark unchanged xml elements of current parent\n 1. mark moved xml elements of current parent\n 1. mark xml elements identified by tag name and attribute names of the current parent\n 1. mark xml elements identified by attributes values and element text of the current parent\n 1. mark xml elements identified by tag name of the current parent\n 1. mark xml elements with xpath that do not exist in the other xml tree as added/deleted of the current parent\n 1. Repeat 3. till all xml elements are identified\n\nAll xml elements that are still marked as changed have to be investigated\n\n## performance ##\n\n[//]: # (insert_performance_start)\n\n```\ntest1: delta_t=0.0699s xml_elements=63\ntest2: delta_t=0.0104s xml_elements=5\ntest3: delta_t=0.0154s xml_elements=10\ntest4: delta_t=0.0240s xml_elements=32\ntest5: delta_t=0.0258s xml_elements=34\ntest6: delta_t=0.0290s xml_elements=34\ntest7: delta_t=0.0124s xml_elements=8\ntest8: delta_t=0.1027s xml_elements=67\ntest9: delta_t=4.2290s xml_elements=6144\ntest11: delta_t=0.0298s xml_elements=34\ntest12: delta_t=0.0288s xml_elements=45\ntest13: delta_t=0.0442s xml_elements=75\n\n```\n\n[//]: # (insert_performance_end)\n\n## coverage ##\n\n[//]: # (insert_coverage_start)\n\n```\nName Stmts Miss Cover\n----------------------------------------------------\nlib\\diffx\\__init__.py 34 5 85%\nlib\\diffx\\base.py 107 2 98%\nlib\\diffx\\differ.py 170 14 92%\nlib\\diffx\\hash.py 71 0 100%\nlib\\diffx\\svg\\__init__.py 0 0 100%\nlib\\diffx\\svg\\coloured_text.py 21 0 100%\nlib\\diffx\\svg\\compact.py 340 34 90%\nlib\\diffx\\svg\\render_text.py 76 2 97%\nlib\\diffx\\xpath.py 54 3 94%\n----------------------------------------------------\nTOTAL 873 60 93%\n\n```\n\n[//]: # (insert_coverage_end)\n\n## open issues ##\n * performance analysis and improvements (different hash algorithms, ...)\n * if there are some users, improve interface\n * investigation of merge interfaces\n\n## release notes ##\nv1.1.1\n* README.md typo corrected\n\nv1.1.0\n* README.md updated\n* main.compare_json implemented\n\nv1.0.1\n* README.md updated\n\nv1.0.0\n* XmlXdiff moved diffx\n* ui improved diffx.main added as entry point\n* code refactored - pythonic, pep8\n* text block introduced\n* performance improved\n\n## documentation ##\n\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/mmoosstt/diffx",
"keywords": "",
"license": "LGPL",
"maintainer": "",
"maintainer_email": "",
"name": "diffx",
"package_url": "https://pypi.org/project/diffx/",
"platform": "",
"project_url": "https://pypi.org/project/diffx/",
"project_urls": {
"Homepage": "https://github.com/mmoosstt/diffx"
},
"release_url": "https://pypi.org/project/diffx/1.1.2/",
"requires_dist": [
"PySide2",
"lxml",
"svgwrite",
"dicttoxml"
],
"requires_python": "",
"summary": "compare xml or json files with svg/html report",
"version": "1.1.2"
},
"last_serial": 5887036,
"releases": {
"1.0.1": [
{
"comment_text": "",
"digests": {
"md5": "4979935883379a63321bf06014b50fdc",
"sha256": "f618e0cfa0893b3cfdbd102d31019ad3faa64339a15f3749a66ee80514e10795"
},
"downloads": -1,
"filename": "diffx-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4979935883379a63321bf06014b50fdc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17073,
"upload_time": "2019-06-14T22:57:26",
"url": "https://files.pythonhosted.org/packages/2c/f2/02e8d9ccb670500bfd8c02d5173c80244f185fa55249cc448d7ffc7643fd/diffx-1.0.1-py3-none-any.whl"
}
],
"1.1.0": [
{
"comment_text": "",
"digests": {
"md5": "4599ea70b0453d013a97a3eca26118f0",
"sha256": "e416f75fb60755534590b9171b22bfe82b367585ad795f1fd814db2620f4fe28"
},
"downloads": -1,
"filename": "diffx-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4599ea70b0453d013a97a3eca26118f0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17528,
"upload_time": "2019-09-25T19:23:37",
"url": "https://files.pythonhosted.org/packages/59/70/540f148826fa6c12494406eaef86eae9fb62d89691f0bb3fe6a031e67041/diffx-1.1.0-py3-none-any.whl"
}
],
"1.1.1": [
{
"comment_text": "",
"digests": {
"md5": "dbb9e821c8ebc4ca8b48ebab22eb586d",
"sha256": "64723339a34d2aa9eabefdfa446c0caf8a4568fae8b4439526329b8842b1b5b2"
},
"downloads": -1,
"filename": "diffx-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dbb9e821c8ebc4ca8b48ebab22eb586d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17365,
"upload_time": "2019-09-25T19:39:33",
"url": "https://files.pythonhosted.org/packages/02/e4/db2ed912f5e91006b473cb7dbc5d402c8a4842269a08627f16fe9677f99c/diffx-1.1.1-py3-none-any.whl"
}
],
"1.1.2": [
{
"comment_text": "",
"digests": {
"md5": "cbb67bd7bc3828f1eb421015dd9c313c",
"sha256": "97be77fa7b1316c4a01a292d408861d67541a6d6dd88165a4910fc3f2ae1af99"
},
"downloads": -1,
"filename": "diffx-1.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cbb67bd7bc3828f1eb421015dd9c313c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17373,
"upload_time": "2019-09-25T19:53:46",
"url": "https://files.pythonhosted.org/packages/b4/7b/11fac9a471181a87098990f2d2b20c36c0dad097bd14056d945220a2c2f7/diffx-1.1.2-py3-none-any.whl"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "cbb67bd7bc3828f1eb421015dd9c313c",
"sha256": "97be77fa7b1316c4a01a292d408861d67541a6d6dd88165a4910fc3f2ae1af99"
},
"downloads": -1,
"filename": "diffx-1.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cbb67bd7bc3828f1eb421015dd9c313c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17373,
"upload_time": "2019-09-25T19:53:46",
"url": "https://files.pythonhosted.org/packages/b4/7b/11fac9a471181a87098990f2d2b20c36c0dad097bd14056d945220a2c2f7/diffx-1.1.2-py3-none-any.whl"
}
]
}