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 convenience 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.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72ce2a564c2eb02ca9f0c4e71934edcced5d7c7fe74703bebf4f15a85b8077ac |
|
MD5 | 9edc536f2019cb046985e65cd85b0661 |
|
BLAKE2b-256 | 0d3505460ee512ac47194f1d85dc1c8b84846fc181da282a52bedc450b989268 |
Hashes for patiencediff-0.2.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d2bb4a1b0e9b5dc13b8a7f5086c476c46ae50e5cc0fc125e90b076aaf8d7d00 |
|
MD5 | 8a0032c8ca906fa817f92767a8dd1ba2 |
|
BLAKE2b-256 | 61729961c1b708b4f9ddfc916c6f19f62db2612e2fd419a1297c9d4da88fd6ae |
Hashes for patiencediff-0.2.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ff8cd093744ea218c9b46328fec56f32793a8683261123b50d293785c5fb717 |
|
MD5 | 967dbf808e06c73e98a55b9f4dea7d4e |
|
BLAKE2b-256 | 5698572a139b3e96d5281b1e03a466ab69e86976e68f628992852ca42c6ed617 |
Hashes for patiencediff-0.2.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 395c89f58604095d8e057604defceadc74387c978c7830c9e230e1e30216065d |
|
MD5 | 548eb4fde4abaef64702074ec6f5b647 |
|
BLAKE2b-256 | 90b1b71a354d03dcd25101179e2187342ac03298f3c122c6c7b48f8f39188bd2 |
Hashes for patiencediff-0.2.3-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 580c20a2c59d9d66146b609962d217890fb69f56ce47159d9aceb2923589681c |
|
MD5 | 10009ca09e128d0996bc842b101261c7 |
|
BLAKE2b-256 | e5922cb2d515a73174ec25c5da40b6af487b4bd2e04c2c10bae90222ecc1c2b3 |