Skip to main content

Creates diffs of XML files

Project description

xmldiff

https://travis-ci.org/regebro/xmldiff2.svg?branch=master https://coveralls.io/repos/github/regebro/xmldiff2/badge.svg

xmldiff is a library and a command line utility for making diffs out of XML.

xmldiff 2.0 is a complete, ground up pure-Python rewrite of xmldiff 1.x. xmldiff 2.x had various problems, mainly that the code is complex and unpythonic, making it hard to maintain and fix bugs, there is also an infinite loop in certain cases, and the c implementation leaks memory, as well as being hard to use as a library.

xmldiff 2.0 is currently significantly slower than xmldiff 2.x, but this may change in the future. Currently we make no effort to make xmldiff 2.0 fast, we concentrate on making it correct and usable.

xmldiff aims to have 100% test coverage. Python 2.7 support will be dropped soon.

The diff algorithm is based on “Change Detection in Hierarchically Structured Information”, and the text diff is using Googles diff_match_patch algorithm.

Contributors

Quick usage

>From the commandline:

$ xmldiff file1.xml file2.xml

As a library:

from lxml import etree
from xmldiff import main, formatting

differ = diff.Differ()
diff = main.diff_files('file1.xml', 'file2.xml',
                       formatter=formatting.XMLFormatter())

print(diff)

There is also a method diff_trees() that take two lxml trees, and a method diff_texts() that will take strings containing XML.

Changes

2.0b1 (2018-09-03)

  • A complete, bottom-up, pure-python rewrite

  • New output formats:

    • A list of actions (similar but not compatible with the old format)

    • XML with changes marked though tags and attributes

    • RML aware XML where tags containing text are semantically diffed, useful for human output such as converting to HTML or PDF

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmldiff-2.0b1.tar.gz (70.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xmldiff-2.0b1-py2.py3-none-any.whl (53.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file xmldiff-2.0b1.tar.gz.

File metadata

  • Download URL: xmldiff-2.0b1.tar.gz
  • Upload date:
  • Size: 70.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.4.1 requests/2.9.2 setuptools/38.2.4 requests-toolbelt/0.7.1 clint/0.5.1 CPython/2.7.12 Linux/4.4.0-133-generic

File hashes

Hashes for xmldiff-2.0b1.tar.gz
Algorithm Hash digest
SHA256 173ad39aa5c95e9deeb563e94174c944ffd814441b2587f5645f0119c192220c
MD5 5f60ea9a2bc0109d1828ae753c332ed2
BLAKE2b-256 5445006a8a3068f261dfbb543e4a4905ea1495a9deaa6b880af881e7112fe590

See more details on using hashes here.

File details

Details for the file xmldiff-2.0b1-py2.py3-none-any.whl.

File metadata

  • Download URL: xmldiff-2.0b1-py2.py3-none-any.whl
  • Upload date:
  • Size: 53.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.4.1 requests/2.9.2 setuptools/38.2.4 requests-toolbelt/0.7.1 clint/0.5.1 CPython/2.7.12 Linux/4.4.0-133-generic

File hashes

Hashes for xmldiff-2.0b1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9a15649073d795f2a742f0c46f44ebc732727ae201cf92e796ffb7b31eaebf59
MD5 0003996e2c8b62541743c80f1367925f
BLAKE2b-256 65350820f8a49e5812dbcdb2aee651f19df8bf7c67d379e449699ed4ede5df51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page