1Metadata-Version: 1.1 2Name: xmldiff 3Version: 2.4 4Summary: Creates diffs of XML files 5Home-page: https://github.com/Shoobx/xmldiff 6Author: Lennart Regebro 7Author-email: lregebro@shoobx.com 8License: MIT 9Description: xmldiff 10 ======== 11 12 .. image:: https://travis-ci.org/Shoobx/xmldiff.svg?branch=master 13 :target: https://travis-ci.org/Shoobx/xmldiff 14 15 .. image:: https://coveralls.io/repos/github/Shoobx/xmldiff/badge.svg 16 :target: https://coveralls.io/github/Shoobx/xmldiff 17 18 ``xmldiff`` is a library and a command-line utility for making diffs out of XML. 19 This may seem like something that doesn't need a dedicated utility, 20 but change detection in hierarchical data is very different from change detection in flat data. 21 XML type formats are also not only used for computer readable data, 22 it is also often used as a format for hierarchical data that can be rendered into human readable formats. 23 A traditional diff on such a format would tell you line by line the differences, 24 but this would not be be readable by a human. 25 ``xmldiff`` provides tools to make human readable diffs in those situations. 26 27 Full documentation is on `xmldiff.readthedocs.io <https://xmldiff.readthedocs.io>`_ 28 29 ``xmldiff`` is still under rapid development, 30 and no guarantees are done that the output of one version will be the same as the output of any previous version. 31 32 33 Quick usage 34 ----------- 35 36 ``xmldiff`` is both a command-line tool and a Python library. 37 To use it from the command-line, just run ``xmldiff`` with two input files:: 38 39 $ xmldiff file1.xml file2.xml 40 41 There is also a command to patch a file with the output from the ``xmldiff`` command:: 42 43 $ xmlpatch file.diff file1.xml 44 45 There is a simple API for using ``xmldiff`` as a library:: 46 47 from lxml import etree 48 from xmldiff import main, formatting 49 50 diff = main.diff_files('file1.xml', 'file2.xml', 51 formatter=formatting.XMLFormatter()) 52 53 There is also a method ``diff_trees()`` that take two lxml trees, 54 and a method ``diff_texts()`` that will take strings containing XML. 55 Similarly, there is ``patch_file()`` ``patch_text()`` and ``patch_tree()``:: 56 57 result = main.patch_file('file.diff', 'file1.xml') 58 59 60 Changes from ``xmldiff`` 0.6/1.x 61 -------------------------------- 62 63 * A complete, ground up, pure-Python rewrite 64 65 * Easier to maintain, the code is less complex and more Pythonic, 66 and uses more custom classes instead of just nesting lists and dicts. 67 68 * Fixes the problems with certain large files and solves the memory leaks. 69 70 * A nice, easy to use Python API for using it as a library. 71 72 * Adds support for showing the diffs in different formats, 73 mainly one where differences are marked up in the XML, 74 useful for making human readable diffs. 75 76 These formats can show text differences in a semantically meaningful way. 77 78 * An output format compatible with 0.6/1.x is also available. 79 80 * 2.0 is currently significantly slower than ``xmldiff`` 0.6/1.x, 81 but this will change in the future. 82 Currently we make no effort to make ``xmldiff`` 2.0 fast, 83 we concentrate on making it correct and usable. 84 85 86 Contributors 87 ------------ 88 89 * Lennart Regebro, regebro@gmail.com (main author) 90 91 * Stephan Richter, srichter@shoobx.com 92 93 * Albertas Agejevas, alga@shoobx.com 94 95 The diff algorithm is based on "`Change Detection in Hierarchically Structured Information <http://ilpubs.stanford.edu/115/1/1995-46.pdf>`_", 96 and the text diff is using Google's ``diff_match_patch`` algorithm. 97 98 Changes 99 ======= 100 101 2.4 (2019-10-09) 102 ---------------- 103 104 - Added an option to pass pairs of (element, attr) as unique 105 attributes for tree matching. Exposed this option on the command 106 line, too. 107 108 2.3 (2019-02-27) 109 ---------------- 110 111 - Added a simple ``xmlpatch`` command and API. 112 113 - Multiple updates to documentation and code style 114 115 116 2.2 (2018-10-12) 117 ---------------- 118 119 - A workaround for dealing with top level comments and the xml formatter 120 121 122 2.1 (2018-10-03) 123 ---------------- 124 125 - Changed the substitution unicode character area to use the Private Use Area 126 in BMP(0), to support narrow Python builds 127 128 - Added --unique-attributes argument. 129 130 131 2.1b1 (2018-10-01) 132 ------------------ 133 134 - Added options for faster node comparisons. The "middle" option is now 135 default, it had very few changes in matches, but is much faster. 136 137 - Implemented a Fast Match algorithm for even faster diffing. 138 139 - Speed improvements through caching 140 141 - Fixed a bug where MoveNode actions sometimes was in the wrong order 142 143 - Added an InsertComment action, as comments require different handling, 144 so it's easier to deal with them this way. You can still use DeleteNode and 145 UpdateTextIn for them with no special handling. 146 147 - When renaming tags the XMLFormatter will mark them with "diff:rename" 148 instead of making a new tag and deleting the old. 149 150 - Tags will now be moved first, and updated and renamed later, as the new 151 tag name or attributes might not be valid in the old location. 152 153 154 2.0 (2018-09-25) 155 ---------------- 156 157 - A complete, bottom-up, pure-python rewrite 158 159 - New easy API 160 161 - 100% test coverage 162 163 - New output formats: 164 165 - A new default output format with new actions 166 167 - A format intended to be parseable by anyone parsing the old format. 168 169 - XML with changes marked though tags and attributes 170 171 - xmldiff 2.0 is significantly slower than xmldiff 0.6 or 1.0, 172 the emphasis so far is on correctness, not speed. 173 174Keywords: xml html diff 175Platform: UNKNOWN 176Classifier: Development Status :: 5 - Production/Stable 177Classifier: Topic :: Text Processing :: Markup :: XML 178Classifier: Operating System :: OS Independent 179Classifier: Programming Language :: Python :: 2 180Classifier: Programming Language :: Python :: 2.7 181Classifier: Programming Language :: Python :: 3 182Classifier: Programming Language :: Python :: 3.5 183Classifier: Programming Language :: Python :: 3.6 184Classifier: Programming Language :: Python :: 3.7 185Classifier: License :: OSI Approved :: MIT License 186