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.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d6ed4152d63a7a691705a9bb5e490f8056dd5046e70d4d937ca6c57d922794e |
|
MD5 | 826ec4050d82cb4efd8405371a1bfbe6 |
|
BLAKE2b-256 | 108791f318270796742d9cdd1b572160dac5078e25c60cace674dce8629e1f41 |
Hashes for patiencediff-0.2.2-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fcc3f9dc12040ddfb8165317af3425c4d2be49b147def22a72a44d43fff5141 |
|
MD5 | 62da8a5f05eb093b9773e33b8051b37c |
|
BLAKE2b-256 | a0e5f89e86cf97e67254d02be7e229bb4c65440b99fc89b1c3c0d6cdb092bf9e |
Hashes for patiencediff-0.2.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63e449c025f00494ddae5bcc0fa3dda5534769d9fa7ae42ef1558f9c518de6dc |
|
MD5 | 771102457c7f04111fc80813953ad0cc |
|
BLAKE2b-256 | 37095e75865126aafaf1e18a524042df81e33e941928016af51138f3c63fb4d7 |
Hashes for patiencediff-0.2.2-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 830be20a2e74972843362d7bc4b7a7929ff63205eade553d83256e51843b64d4 |
|
MD5 | 1c4af88974f64af338d8a86f1490a316 |
|
BLAKE2b-256 | 1fc647236b0d25c296779d5fd798d9671613fd522bbfce3dd4dc58455bfbbb0b |
Hashes for patiencediff-0.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e918940e2751bec373675eef1246278e2ff2188d1ef8947242820b6c9bb8758c |
|
MD5 | 01e825a304fbc3d990b6ed79df957613 |
|
BLAKE2b-256 | 699aacb48b33fb6c6105e0b2b8f13eb41ad98485c439df2dda102976aa445117 |
Hashes for patiencediff-0.2.2-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f196516e980f17302317f2f6f6a4c2897c6107c34c5268d9d37b820e98fd0deb |
|
MD5 | 1885f497e47ab1772a0e2c6d6d6003c4 |
|
BLAKE2b-256 | 600c7ea80574cc10db8c61dbf9a3099422da7ba0d2b6059111a087e18f84a276 |
Hashes for patiencediff-0.2.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc257e6e5adccd458a1754701e096ca786bf0e62dd3cbda8924df22be4b45f94 |
|
MD5 | 5a735242b3bea3366c2109cb9d1376b3 |
|
BLAKE2b-256 | eddc563e9552c830c59a7cdcb271b038df275ea72fa756277e8bff4e59843b43 |
Hashes for patiencediff-0.2.2-cp36-cp36m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e15b894d1941ed773b6c5f7479985fc17ec81bab33f82e3b736ab1920c1804d6 |
|
MD5 | 1bb77a8c4b7b3b658abd78c086417549 |
|
BLAKE2b-256 | 2d15410cc79a28a7b84bb949cdd51f0fd738770e05608fdf3e3684f2092ce98e |