Python implementation of the patiencediff algorithm.
Project description
This package contains the implementation of the patiencediff algorithm, as first described by Bram Cohen.
Like Python’s difflib, this module provides both a convience unified_diff function for the generation of unified diffs of text files as well as a SequenceMatcher that can be used on arbitrary lists.
Patiencediff provides a good balance of performance, nice output for humans, and implementation simplicity.
The code in this package was extracted from the Bazaar code base.
The package comes with two implementations:
A Python implementation (_patiencediff_py.py); this implementation only requires a Python interpreter and is the more readable version of the two
A C implementation implementation (_patiencediff_c.c); this implementation is faster, but requires a C compiler and is less readable
Usage
To invoke patiencediff from the command-line:
python -m patiencediff file_a file_b
Or from Python:
>>> import patiencediff >>> print ''.join(patiencediff.unified_diff( ... ['a\n', 'b\n', 'b\n', 'c\n'], ... ['a\n', 'c\n', 'b\n'])) --- +++ @@ -1,4 +1,3 @@ a +c b -b -c
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for patiencediff-0.1.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfb5bf7f5b494ba3a02d64a034ca76a9d90cee73b9a9a2b8318a9eaa00331306 |
|
MD5 | b3bdc24784455565cc9dc797c2c20ea4 |
|
BLAKE2b-256 | ce6cd2d81f6ec4f23eaab09411529135ec0b56023218ece5526c3fcc1d44379f |
Hashes for patiencediff-0.1.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 956bbd7451044e8902cdde671c24429c242b035a42d5f40f3c547223d0badba2 |
|
MD5 | dcc86a6fe0f8b6a30fbf439f3ae35aa6 |
|
BLAKE2b-256 | 84ef3b058ffd50263ae28162fa121dc8558163db1243cef49eebb33295a9bb62 |
Hashes for patiencediff-0.1.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 050eec9ab2bf6901559aff5d5fdc9a5f55a391e68959a3802ff8f29ae123974b |
|
MD5 | 8e47dbd9660fc8aa94f4392beddb6923 |
|
BLAKE2b-256 | 7420d822c14a6490b26010e0c63f06675e2c16af34c61ebebf8d2b00459fa0c5 |
Hashes for patiencediff-0.1.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f5f96358a70ad81220104c9477a401c86cc342abbd14cb89405448311f53e09 |
|
MD5 | 58342025373c55ace406331c46c76a1a |
|
BLAKE2b-256 | 6a362426710eabdb37b09885dfdd9997c2636846ac75e1287a567e769c4c20e0 |
Hashes for patiencediff-0.1.0-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc85f98291a2555f33764c7d16ca853754669d5117ce0f3e0066a966761d0962 |
|
MD5 | 061d5db42789a45e11b0b408e00f3a3e |
|
BLAKE2b-256 | 65f196876fac9e74d311f11938740316517f4abb2c69843fff431c10ba8e7e09 |
Hashes for patiencediff-0.1.0-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ef76135639659a2bdbfa3a10cfae9e4753302838a62d083db8b44eab3de5547 |
|
MD5 | 281e0595f3c104e4fa12ecf3afedc859 |
|
BLAKE2b-256 | 0dcbe2797bebb8de0d25fb604ed6bfedc0e4906cf8ffa2aafb65e23578ebc382 |