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

Uploaded Source

Built Distributions

patiencediff-0.2.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (55.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

patiencediff-0.2.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (54.8 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

patiencediff-0.2.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (56.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

patiencediff-0.2.3-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.3-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (54.5 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

File details

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

File metadata

  • Download URL: patiencediff-0.2.3.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for patiencediff-0.2.3.tar.gz
Algorithm Hash digest
SHA256 013c931850e8986518f1ee7792b049cd581a6fb91e77bddf6c8230a7adfeb732
MD5 32d884a7425dba755b20c605dbfffce4
BLAKE2b-256 4c97d67566cf35518cb6c87051a3beafd10f203519b8619bede22455024c2e5a

See more details on using hashes here.

File details

Details for the file patiencediff-0.2.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

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

File metadata

File hashes

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

See more details on using hashes here.

File details

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

File metadata

File hashes

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

See more details on using hashes here.

File details

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

File metadata

File hashes

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

See more details on using hashes here.

File details

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

File metadata

File hashes

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

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