Skip to main content

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


Download files

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

Source Distribution

patiencediff-0.2.2.tar.gz (28.8 kB view details)

Uploaded Source

Built Distributions

patiencediff-0.2.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (54.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

patiencediff-0.2.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (55.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

patiencediff-0.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (54.4 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

patiencediff-0.2.2-cp37-cp37m-manylinux2014_aarch64.whl (60.0 kB view details)

Uploaded CPython 3.7m

patiencediff-0.2.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (54.4 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

patiencediff-0.2.2-cp36-cp36m-manylinux2014_aarch64.whl (59.0 kB view details)

Uploaded CPython 3.6m

File details

Details for the file patiencediff-0.2.2.tar.gz.

File metadata

  • Download URL: patiencediff-0.2.2.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for patiencediff-0.2.2.tar.gz
Algorithm Hash digest
SHA256 456d9fc47fe43f9aea863059ea2c6df5b997285590e4b7f9ee8fbb6c3419b5a7
MD5 5318268750a4b985700c2a48a1dbf825
BLAKE2b-256 90ca13cdabb3c491a0ccd7d580419b96abce3d227d4a6ba674364e6b19d4d67e

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.2-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

  • Download URL: patiencediff-0.2.2-cp39-cp39-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 59.7 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for patiencediff-0.2.2-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5fcc3f9dc12040ddfb8165317af3425c4d2be49b147def22a72a44d43fff5141
MD5 62da8a5f05eb093b9773e33b8051b37c
BLAKE2b-256 a0e5f89e86cf97e67254d02be7e229bb4c65440b99fc89b1c3c0d6cdb092bf9e

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.2-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

  • Download URL: patiencediff-0.2.2-cp38-cp38-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 60.6 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for patiencediff-0.2.2-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 830be20a2e74972843362d7bc4b7a7929ff63205eade553d83256e51843b64d4
MD5 1c4af88974f64af338d8a86f1490a316
BLAKE2b-256 1fc647236b0d25c296779d5fd798d9671613fd522bbfce3dd4dc58455bfbbb0b

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.2-cp37-cp37m-manylinux2014_aarch64.whl.

File metadata

  • Download URL: patiencediff-0.2.2-cp37-cp37m-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 60.0 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for patiencediff-0.2.2-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f196516e980f17302317f2f6f6a4c2897c6107c34c5268d9d37b820e98fd0deb
MD5 1885f497e47ab1772a0e2c6d6d6003c4
BLAKE2b-256 600c7ea80574cc10db8c61dbf9a3099422da7ba0d2b6059111a087e18f84a276

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.2-cp36-cp36m-manylinux2014_aarch64.whl.

File metadata

  • Download URL: patiencediff-0.2.2-cp36-cp36m-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 59.0 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for patiencediff-0.2.2-cp36-cp36m-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e15b894d1941ed773b6c5f7479985fc17ec81bab33f82e3b736ab1920c1804d6
MD5 1bb77a8c4b7b3b658abd78c086417549
BLAKE2b-256 2d15410cc79a28a7b84bb949cdd51f0fd738770e05608fdf3e3684f2092ce98e

See more details on using hashes here.

Supported by

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