Skip to main content

CleverDiff

Build Status

A tool for describing multiple differences in files.

Why?

If you have to compare files which contain multiple differences that are the same, you will know how tedius it is to step through every single hunk of the standard diff output. CleverDiff will show you each unique diff hunk once, then give you a summary of where else it has found the difference across multiple files.

Installation

CleverDiff is available on PyPI:

pip install --user cleverdiff

Usage

Run the cleverdiff.py script, with each pair of files separated with = as arguments:

python3 cleverdiff.py test_data/ref1.def=test_data/new1.def test_data/ref2.def=test_data/new2.def

Or run the cleverdiff.py script, with --old followed by a list of reference files and --new followed by a list of modified files:

python3 cleverdiff.py --old test_data/ref.def test_data/ref2.def \
                      --new test_data/new.def test_data/new2.def

CleverDiff will find the differences between each pair of files, then determine which are identical across all files, and give you a summary:

--------------------------------------------
DIFF   0:
insert in ref.def:49 vs new.def:50:
+        edit FOO bar

This difference is replicated elsewhere:
 * with identical diff in different files:
    ref2.def:49 vs new2.def:50


--------------------------------------------
DIFF   1:
change in ref.def:339 vs new.def:340:
-              family sat_172
-                edit WMOID '172'
+              family sat_173
+                edit WMOID '173'

This difference is replicated elsewhere:
 * with identical diff in different files:
    ref2.def:339 vs new2.def:340
 * with same diff but different line numbers:
    ref.def:376 vs new.def:377
    ref.def:413 vs new.def:414
    ref.def:450 vs new.def:451
    ref.def:487 vs new.def:488
    ref2.def:376 vs new2.def:377
    ref2.def:413 vs new2.def:414
    ref2.def:450 vs new2.def:451
    ref2.def:487 vs new2.def:488

Version history

v0.3

Contributors: @vhsw

  • Add command-line arguments --old and --new (#7)
  • Add black, isort & pyflakes to CI tests (#4)

v0.2

Contributors: @andrewcbennett Introduces ecFlow context (#2). Bug fixes.

v0.1.2

Contributors: @andrewcbennett (with thanks to @takluyver) Fixes failing tests. Adds Travis CI config.

v0.1

Contributors: @andrewcbennett (with thanks to @takluyver) initial version

Metadata

Release files for cleverdiff 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cleverdiff 0.3
File Size Uploaded
cleverdiff-0.3.tar.gz 25.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cleverdiff 0.3
File Interpreter ABI Platform
cleverdiff-0.3-py3-none-any.whl Python 3 none any Details

Total release size: 180.5 kB

Release files / cleverdiff-0.3.tar.gz

Download URL cleverdiff-0.3.tar.gz
Size 25.1 kB
Tags Source
SHA-256 checksum
How to use checksums
84c038da946943306f0db1794a7a650f905bc973c51302f41b300660defba042
BLAKE2b-256 checksum
How to use checksums
eb457d9e5cb8491dde17ab8d1e1bc9b01e3438010304af2819de086c459e46bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Release files / cleverdiff-0.3-py3-none-any.whl

Download URL cleverdiff-0.3-py3-none-any.whl
Size 155.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49384b64d373ee27d7c5785963989dd394e5869caec5d3746017ea46d4430368
BLAKE2b-256 checksum
How to use checksums
bed1dc13561621ecb312c90b54f7df7ced0f91f64097ef25b0c47c797801aa00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Release history Release notifications | RSS feed

This release

0.3 This release

2 release files

0.2

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page