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 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


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.1.0.tar.gz (20.0 kB view details)

Uploaded Source

Built Distributions

patiencediff-0.1.0-cp36-cp36m-win_amd64.whl (31.7 kB view details)

Uploaded CPython 3.6m Windows x86-64

patiencediff-0.1.0-cp36-cp36m-win32.whl (29.6 kB view details)

Uploaded CPython 3.6m Windows x86

patiencediff-0.1.0-cp35-cp35m-win_amd64.whl (31.7 kB view details)

Uploaded CPython 3.5m Windows x86-64

patiencediff-0.1.0-cp35-cp35m-win32.whl (29.5 kB view details)

Uploaded CPython 3.5m Windows x86

patiencediff-0.1.0-cp27-cp27m-win_amd64.whl (29.3 kB view details)

Uploaded CPython 2.7m Windows x86-64

patiencediff-0.1.0-cp27-cp27m-win32.whl (28.1 kB view details)

Uploaded CPython 2.7m Windows x86

File details

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

File metadata

  • Download URL: patiencediff-0.1.0.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for patiencediff-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7cd316f57f7b4086923cc0db80273886416134d82945dddd0aa24f0e95c7d302
MD5 3a724bca8292cfd2e444a46c833f91c7
BLAKE2b-256 582374657b1e981f107981003e69177a476605871fb3e528995a1f4d1b9b47b1

See more details on using hashes here.

File details

Details for the file patiencediff-0.1.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: patiencediff-0.1.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for patiencediff-0.1.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 bfb5bf7f5b494ba3a02d64a034ca76a9d90cee73b9a9a2b8318a9eaa00331306
MD5 b3bdc24784455565cc9dc797c2c20ea4
BLAKE2b-256 ce6cd2d81f6ec4f23eaab09411529135ec0b56023218ece5526c3fcc1d44379f

See more details on using hashes here.

File details

Details for the file patiencediff-0.1.0-cp36-cp36m-win32.whl.

File metadata

  • Download URL: patiencediff-0.1.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 29.6 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for patiencediff-0.1.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 956bbd7451044e8902cdde671c24429c242b035a42d5f40f3c547223d0badba2
MD5 dcc86a6fe0f8b6a30fbf439f3ae35aa6
BLAKE2b-256 84ef3b058ffd50263ae28162fa121dc8558163db1243cef49eebb33295a9bb62

See more details on using hashes here.

File details

Details for the file patiencediff-0.1.0-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: patiencediff-0.1.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.4

File hashes

Hashes for patiencediff-0.1.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 050eec9ab2bf6901559aff5d5fdc9a5f55a391e68959a3802ff8f29ae123974b
MD5 8e47dbd9660fc8aa94f4392beddb6923
BLAKE2b-256 7420d822c14a6490b26010e0c63f06675e2c16af34c61ebebf8d2b00459fa0c5

See more details on using hashes here.

File details

Details for the file patiencediff-0.1.0-cp35-cp35m-win32.whl.

File metadata

  • Download URL: patiencediff-0.1.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 29.5 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.4

File hashes

Hashes for patiencediff-0.1.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 2f5f96358a70ad81220104c9477a401c86cc342abbd14cb89405448311f53e09
MD5 58342025373c55ace406331c46c76a1a
BLAKE2b-256 6a362426710eabdb37b09885dfdd9997c2636846ac75e1287a567e769c4c20e0

See more details on using hashes here.

File details

Details for the file patiencediff-0.1.0-cp27-cp27m-win_amd64.whl.

File metadata

  • Download URL: patiencediff-0.1.0-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.16

File hashes

Hashes for patiencediff-0.1.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 cc85f98291a2555f33764c7d16ca853754669d5117ce0f3e0066a966761d0962
MD5 061d5db42789a45e11b0b408e00f3a3e
BLAKE2b-256 65f196876fac9e74d311f11938740316517f4abb2c69843fff431c10ba8e7e09

See more details on using hashes here.

File details

Details for the file patiencediff-0.1.0-cp27-cp27m-win32.whl.

File metadata

  • Download URL: patiencediff-0.1.0-cp27-cp27m-win32.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: CPython 2.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.16

File hashes

Hashes for patiencediff-0.1.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 0ef76135639659a2bdbfa3a10cfae9e4753302838a62d083db8b44eab3de5547
MD5 281e0595f3c104e4fa12ecf3afedc859
BLAKE2b-256 0dcbe2797bebb8de0d25fb604ed6bfedc0e4906cf8ffa2aafb65e23578ebc382

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