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. 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
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.
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.1.0
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.1.0.tar.gz | 46.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| similar_files-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 86.2 kB
Release files / similar_files-0.1.0.tar.gz
| Download URL | similar_files-0.1.0.tar.gz |
|---|---|
| Size | 46.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2ce7c015d3ba00fcc490b5c173e2e1413ae1e93cfd4c7f03d119590f330de10
|
|
BLAKE2b-256 checksum How to use checksums |
4e5b5509e6802e08b378166df2c585e101ffee4fd090201d646e2d81ced98808
|
| 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.1.0-py3-none-any.whl
| Download URL | similar_files-0.1.0-py3-none-any.whl |
|---|---|
| Size | 40.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74f308a3c16ce027b0633a042cef6cb07e42ea83dbf60e75b01e547a6bfa772d
|
|
BLAKE2b-256 checksum How to use checksums |
94aee2e8dbdf53ac76178456db4883006f9a71a0947e07684b6c57330f14eb45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|