Skip to main content

triplecheck

PyPI Version OS Ruff ty CI codecov

triplecheck is a two- and three-way file and directory comparison tool:

  • For files it compares their hashes.
  • For directories, it either compares the hashes of every file (full comparison mode), or compares file names and sizes (default). And it contains an optional -i flag to ignore folder structure and focus exclusively on files (useful if directories have been nested, moved around or renamed in one of your copies).

Two hash functions are available: xxhash for high-throughput and blake3 for cryptographic hashing.

🚀 Installation

  1. Install the uv package manager with the official installer, or:
  • macOS: brew install uv
  • Windows: winget install astral-sh.uv
  • Linux (Debian): apt-get install uv
  1. Install the tool:
uv tool install triplecheck
  1. Test the installation (if the command is not recognised try uv tool update-shell and restart Terminal):
triplecheck --version

📖 Usage examples

Compare two files:

triplecheck "path/to/file1" "path/to/file2"

Compare two (or three) directories:

triplecheck "path/to/dir1" "path/to/dir2" "path/to/dir3"            # metadata-only comparison (filenames and file sizes)
triplecheck -f "path/to/dir1" "path/to/dir2"                        # full  comparison: hash every file
triplecheck -i "path/to/dir1" "path/to/dir2"                        # ignore folder structure
triplecheck -e "*.mhl" -e "*.txt" "path/to/dir1" "path/to/dir2"     # exclude .mhl and .txt files

Compare two (or three) directories on different machines:

triplecheck --molist "path/to/local/dir1"                           # creates "molist_dir1.tsv"
triplecheck --molist "path/to/remote/dir2"                          # creates "molist_dir2.tsv"
triplecheck --mocompare "molist_dir1.tsv" "molist_dir2.tsv"

Check that the destination contains all of the files from the source

triplecheck --diff "path/to/src" "path/to/dst" | grep "<"

Output is composed of pairs or triads representing the relationship between the paths (<, > and >> represent the paths provided). In the example below IMG_0421.mov exists only in PRJ_MST01, while IMG_0422.mov exists everywhere but the copy on PRJ_BAK02 is different to the others.

$ triplecheck /Volumes/PRJ_MST01 /Volumes/PRJ_BAK01 /Volumes/PRJ_BAK02
<  ∃ IMG_0421.mov
>  ∄ IMG_0421.mov
>> ∄ IMG_0421.mov

<  = IMG_0422.mov
>  = IMG_0422.mov
>> ≠ IMG_0422.mov

Two-way comparison with --diff offers an alternative output format for those familiar with diff. Lines starting with < are unique to the first path, > lines are unique to the second path:

$ triplecheck --diff /Volumes/PRJ_MST01 /Volumes/PRJ_BAK01
< IMG_0421.mov
> IMG_0422.mov

Run triplecheck --help to see the full list of options.

🤝 Acknowledgments

A special thank you to Mohammad Ayyash for initiating me into the dark magic of Python and Bash, and writing the first "molist" commands from which this utility evolved.

Metadata

Release files for triplecheck 2.1.0

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

Source distribution (sdist)

Source distribution for triplecheck 2.1.0
File Size Uploaded
triplecheck-2.1.0.tar.gz 34.7 kB Details

Built distribution (wheel)

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

Total release size: 47.0 kB

Release files / triplecheck-2.1.0.tar.gz

Download URL triplecheck-2.1.0.tar.gz
Size 34.7 kB
Tags Source
SHA-256 checksum
How to use checksums
220aa7fc49a5a64b9f90efcba2fa22bff7216d890f2407bd0040491a0bb0aff1
BLAKE2b-256 checksum
How to use checksums
d0da58db10bbb2aa1c228e38605ec23a6fe0c0aa37ce511b8fab7c778462eb32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / triplecheck-2.1.0-py3-none-any.whl

Download URL triplecheck-2.1.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e2bb998cef364689675df8ca80bccf0f218d51f8060b918a7e5fe31e74b5c3f
BLAKE2b-256 checksum
How to use checksums
eeb89cc4a25d188c66c434733934af0f362c8e795ccdf7e74061562b2e13acca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

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