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.2.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c2278b8f0520e754f253a2113647620a1a467ee353a779e9bd068608007d161 |
|
MD5 | 10d3538a674151ac56e751fc8e9e3caf |
|
BLAKE2b-256 | 7e06da81e20c51a28ea3599e397836236eb230f1f54b4ea48c51628a54df7e4a |
Hashes for patiencediff-0.2.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7af0dfe47b702b60d0e221dabfc37771a07072c6d72630afe13592a62e36408 |
|
MD5 | ba8f022a5c1e06065e141402673fe926 |
|
BLAKE2b-256 | 830fd21f3a6c149a09529604a0357f53a2d0ede8f2ff8ecfffa195134305557c |
Hashes for patiencediff-0.2.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e8a83a0f0e7efb2c5d35122eb1b48e5f3f8d647f77e7c6d59aec9c3d3222aea |
|
MD5 | 1b844924822a90248014a9e46cefb248 |
|
BLAKE2b-256 | 3374a4cadce233bdb295d5aaa564a99113fce29cce51aefd0397d9ea70051e23 |
Hashes for patiencediff-0.2.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88bbd3cc2de1aed9e9b1a34a30e05a52d397ee7e75559cb132d94315479403ee |
|
MD5 | da15b5e8079ac020e879dfb2a8ebe8cc |
|
BLAKE2b-256 | f5480b0efe02f6c80df8c78859198711b2d47556b65865f25102cbfb832312db |
Hashes for patiencediff-0.2.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f98408aaffc6db3ab418ef688049d160dbf27e19a787649822ca0557a2d94993 |
|
MD5 | 9693bd802331358d0ce6343db84d25d4 |
|
BLAKE2b-256 | 4a3cb23b104b3120c26ff222565fa5d2d2bdab2840b8330b6079aa2d4b17e28a |
Hashes for patiencediff-0.2.1-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dffe41273778f26d1a68c33d7100a8feb3fcd68159b2e0dff99da78f2b759b9b |
|
MD5 | d68b18960f7cfd1be10b07b8c58c0897 |
|
BLAKE2b-256 | ca59a5704c26a1bba5897725865402567ae0362032edf7b921a9fb767ec8cc69 |
Hashes for patiencediff-0.2.1-cp35-cp35m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 882119779b571e423161fc25fe6612f442b66e76252ebda6fc9231288f079bcd |
|
MD5 | 66e05971723e6e814a09927719533eb1 |
|
BLAKE2b-256 | 1d125438353e540cb055ce431d3a37ed7077ce2238c89abd157fea0ad6046d24 |