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

Uploaded Source

Built Distributions

patiencediff-0.2.1-cp38-cp38-win_amd64.whl (32.3 kB view details)

Uploaded CPython 3.8 Windows x86-64

patiencediff-0.2.1-cp38-cp38-macosx_10_14_x86_64.whl (28.9 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

patiencediff-0.2.1-cp37-cp37m-win_amd64.whl (32.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

patiencediff-0.2.1-cp37-cp37m-macosx_10_14_x86_64.whl (28.8 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

patiencediff-0.2.1-cp36-cp36m-win_amd64.whl (32.3 kB view details)

Uploaded CPython 3.6m Windows x86-64

patiencediff-0.2.1-cp36-cp36m-macosx_10_14_x86_64.whl (28.8 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

patiencediff-0.2.1-cp35-cp35m-macosx_10_14_x86_64.whl (28.8 kB view details)

Uploaded CPython 3.5m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: patiencediff-0.2.1.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.4.2 requests/2.23.0 setuptools/44.1.1 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.6

File hashes

Hashes for patiencediff-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9b0a00a0ec3e9fd90c3c3a280065a7c35315c8ed3f93520da0a9bcd70511a25a
MD5 ae1ca1b7bdc47b5a38493a7f87851cfa
BLAKE2b-256 a6fd89f23fa65f6660d40a677a32ef784006612a5577910a540997d337c5053f

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: patiencediff-0.2.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for patiencediff-0.2.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2c2278b8f0520e754f253a2113647620a1a467ee353a779e9bd068608007d161
MD5 10d3538a674151ac56e751fc8e9e3caf
BLAKE2b-256 7e06da81e20c51a28ea3599e397836236eb230f1f54b4ea48c51628a54df7e4a

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.1-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: patiencediff-0.2.1-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for patiencediff-0.2.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e7af0dfe47b702b60d0e221dabfc37771a07072c6d72630afe13592a62e36408
MD5 ba8f022a5c1e06065e141402673fe926
BLAKE2b-256 830fd21f3a6c149a09529604a0357f53a2d0ede8f2ff8ecfffa195134305557c

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: patiencediff-0.2.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for patiencediff-0.2.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6e8a83a0f0e7efb2c5d35122eb1b48e5f3f8d647f77e7c6d59aec9c3d3222aea
MD5 1b844924822a90248014a9e46cefb248
BLAKE2b-256 3374a4cadce233bdb295d5aaa564a99113fce29cce51aefd0397d9ea70051e23

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.1-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: patiencediff-0.2.1-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for patiencediff-0.2.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 88bbd3cc2de1aed9e9b1a34a30e05a52d397ee7e75559cb132d94315479403ee
MD5 da15b5e8079ac020e879dfb2a8ebe8cc
BLAKE2b-256 f5480b0efe02f6c80df8c78859198711b2d47556b65865f25102cbfb832312db

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for patiencediff-0.2.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f98408aaffc6db3ab418ef688049d160dbf27e19a787649822ca0557a2d94993
MD5 9693bd802331358d0ce6343db84d25d4
BLAKE2b-256 4a3cb23b104b3120c26ff222565fa5d2d2bdab2840b8330b6079aa2d4b17e28a

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.1-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: patiencediff-0.2.1-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.12

File hashes

Hashes for patiencediff-0.2.1-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 dffe41273778f26d1a68c33d7100a8feb3fcd68159b2e0dff99da78f2b759b9b
MD5 d68b18960f7cfd1be10b07b8c58c0897
BLAKE2b-256 ca59a5704c26a1bba5897725865402567ae0362032edf7b921a9fb767ec8cc69

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.1-cp35-cp35m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: patiencediff-0.2.1-cp35-cp35m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: CPython 3.5m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.5.10

File hashes

Hashes for patiencediff-0.2.1-cp35-cp35m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 882119779b571e423161fc25fe6612f442b66e76252ebda6fc9231288f079bcd
MD5 66e05971723e6e814a09927719533eb1
BLAKE2b-256 1d125438353e540cb055ce431d3a37ed7077ce2238c89abd157fea0ad6046d24

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