Skip to main content

file-dedupe

PyPI Python Versions License: MIT CI

GitHub Sponsors Patreon Buy Me a Coffee PayPal

Find and replace duplicate files across one or more folders with hardlinks.
Uses fast parallel hashing with file attribute awareness to safely deduplicate files in-place.
Part of the Infinito.Nexus ecosystem.


📦 Installation

The tool is published on PyPI and can be installed using pip:

pip install fidedu

This installs the global command:

fidedu

You can also invoke it explicitly as a module:

python -m fidedu --help

🚀 Usage

Basic Examples

Analyze duplicates across one or more directories (dry-run mode):

fidedu ~/Documents ~/Downloads ~/Pictures

Replace duplicates with hardlinks to one canonical copy (in-place deduplication):

fidedu ~/Documents ~/Downloads ~/Pictures --compress

Verbose output (show exactly what happens):

fidedu ~/Documents ~/Downloads ~/Pictures --compress -v

Equivalent module invocation:

python -m fidedu ~/Documents ~/Downloads --compress -v

⚙️ Behavior

  1. Scans all provided folders recursively.
  2. Groups files with identical size.
  3. For each candidate group, computes a BLAKE2b hash including file attributes (mode, UID, GID, size, and modification time).
  4. Files with matching hashes are treated as true duplicates.
  5. One canonical copy is kept; all others are replaced by hardlinks pointing to it.
  6. When --compress is not used, the tool reports potential savings only (no changes are made).

Command Line Options

Option Description
--compress Apply deduplication (replace duplicates with hardlinks). Default is dry-run mode.
-v, --verbose Verbose output (show detailed linking actions).
-w, --workers N Number of parallel hashing processes (default: CPU count).

Example Output

Duplicate sets found: 12
Files involved:       57
Planned relinks:      45
Estimated savings:    1.2 GB (1,234,567,890 bytes)

[dry-run] Use --compress to apply these changes.

🧪 Testing

Run all tests locally:

make test

Lint the codebase:

make lint

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


👤 Author

Kevin Veen-Birkenbach https://veen.world

Metadata

Release files for fidedu 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 fidedu 2.1.0
File Size Uploaded
fidedu-2.1.0.tar.gz 10.5 kB Details

Built distribution (wheel)

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

Total release size: 18.9 kB

Release files / fidedu-2.1.0.tar.gz

Download URL fidedu-2.1.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f9dbe45b26658abf12b44035a0bfa1ea2b42353dc16da83f5efb5635c0200995
BLAKE2b-256 checksum
How to use checksums
3f8a56b4bf8e47179763f9aa92dc50c13a880e2f162b7b8ad90b8211ed2c0978
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

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

Download URL fidedu-2.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
140fc1131bcebbbe936a45a09138d86070f6f20f97bc475d139bba6e0c7db4d4
BLAKE2b-256 checksum
How to use checksums
836b9a9266f2746abe105100941aadaadd06ce2ddc022aba6cfe0cecb281183a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

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