similar-files
Find files that are the same, or that look the same, and get each group as a playlist you can open anywhere.
Status: early development. The command line and the library may still change between releases.
What it finds
- Identical files: the same bytes under different names or in different folders. Needs nothing beyond Python.
- Similar images: the same picture resized, re-encoded or lightly edited. Uses an optional dependency.
- Similar videos: the same video re-encoded, resized or re-muxed, and
clips cut out of a longer video. Needs ffmpeg on your
PATH. - Similar audio: the same recording re-encoded, or with its tags changed.
Needs
fpcalcfrom Chromaprint on yourPATH(brew install chromaprint,apt install libchromaprint-tools).
Content-aware matching ("screenshots of receipts") is planned for later.
How it works
pip install similar-files # identical files only
pip install "similar-files[image]" # plus similar images (needs only Pillow)
similar-files scan ~/Pictures --out ~/similar-groups # identical files
similar-files scan ~/Pictures --out ~/similar-images -m image # similar images
similar-files scan ~/Movies --out ~/similar-videos -m video # similar videos
similar-files scan ~/Music --out ~/similar-music -m audio # similar audio
similar-files scan ~/Pictures --out ~/copies -r ~/Desktop/logo.png # copies of one file
From a checkout, run python -m similar_files instead of similar-files.
--threshold (0–1) sets how close a match must be, and
similar-files extractors lists what can be compared.
Each group becomes one .m3u8 playlist in the output folder, and its first
line is the file the others were compared with:
~/similar-groups/
IMG_0012.jpg (3).m3u8
logo_final.png (2).m3u8
M3U is a plain, widely supported list format, so you review a group in whatever tool you like: a media player, XeFM (press Enter on a playlist to see its files in a pane and copy, move or delete them there), or a text editor.
Two guarantees:
- similar-files never deletes, moves or changes your files. It only reads them, and you decide what to keep.
- It writes nothing next to your files. Features it computes are cached in your user cache folder, so a second scan is fast. You can delete that cache at any time.
Watching a scan from another program
A long scan does not need anyone to stay attached to it. Start it with
--status FILE, and it keeps its progress in that file as JSON (replaced
whole each time, and rewritten every few seconds while it runs). Create the
file named by --stop-file FILE to stop it the way Ctrl-C does: the groups
found so far are still written.
similar-files scan ~/Movies --out ~/groups -m video \
--status ~/scan/status.json --stop-file ~/scan/stop
Add --format tree and --out names one .xft file instead of a folder.
It holds every group, and it is rewritten every few minutes while the scan
runs, so you can start looking before the scan ends. Those intermediate
groups are provisional: a file read later can still join one, or start a
new group. The last write is final. XeFM opens this file the way it opens an
archive.
XeFM starts scans this way, so they keep running after you close it. See doc/STATUS_FORMAT.md.
Using it from Python
The command line is a thin wrapper. The scanning, caching and grouping are a library that other programs can call, and XeFM is the first program to use it. See doc/LIBRARY.md, and for the formats other programs read, doc/PLAYLIST_FORMAT.md and doc/CACHE.md.
License
MIT. See LICENSE.
Metadata
Release files for similar-files 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| similar_files-0.2.1.tar.gz | 65.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| similar_files-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 118.6 kB
Release files / similar_files-0.2.1.tar.gz
| Download URL | similar_files-0.2.1.tar.gz |
|---|---|
| Size | 65.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6298b79794bc91a06db115bed76ee6842f287557e44480c873bd1861f726efd1
|
|
BLAKE2b-256 checksum How to use checksums |
585dd47a459ea095536aca308c0187f9d51100dafab678551153018cac829e36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / similar_files-0.2.1-py3-none-any.whl
| Download URL | similar_files-0.2.1-py3-none-any.whl |
|---|---|
| Size | 53.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2c1a7fdbf5b5e129dd502db1b4dc4c95a41d4d0d6593d4f49d00cdb2ae7e25d
|
|
BLAKE2b-256 checksum How to use checksums |
48ee3ed8c80d2b99f71511aa761046b605acf6a0640194986b78a84fef1f91b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|