Two- or three-way comparison tool for files and directories
Project description
triplecheck
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
-iflag to ignore folder structure and focus exclusively on files (useful if directories have been nested, moved around or renamed in one of your copies).
This is a cross-platform tool (macOS / Linux / Windows) written in Python and integrating the xxhash package for high-throughput hashing and blake3 for cryptographic hashing.
🚀 Installation
- Install the
uvpackage manager with the official installer, or:
- macOS:
brew install uv - Windows:
winget install astral-sh.uv - Linux (Debian):
apt-get install uv
- Install the tool:
uv tool install triplecheck
- Test the installation (if the command is not recognised try
uv tool update-shelland restart Terminal):
triplecheck --version
📖 Usage examples
Compare two (or three) files or directories:
triplecheck "path/to/file1" "path/to/file2" # full comparison of files
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 directory 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
Check that the destination contains all of the files from the source:
triplecheck "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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file triplecheck-2.0.0.tar.gz.
File metadata
- Download URL: triplecheck-2.0.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f9a31544413c9e85be7eacfc0679e9b1358f08190e47116da0dae0803c86976
|
|
| MD5 |
e430a71b0b70ea6baa8759ec245d10a2
|
|
| BLAKE2b-256 |
868eaef0257d11847d9a1349475935dd8841b258bbbfcd3c0d8164face1cc756
|
File details
Details for the file triplecheck-2.0.0-py3-none-any.whl.
File metadata
- Download URL: triplecheck-2.0.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c99a86dd5a4a91a6d6cb13a9f76885f1b7862d65a13e7c8c94be28ec7bd79f0a
|
|
| MD5 |
1e2c6d9603d22aa43e93dcaf0e09069c
|
|
| BLAKE2b-256 |
e3661b095c341ab9c5ecb55b2f30277b359145f2794db79d34b6b540d7a4cd70
|