PYTHON / DUPLICATE FILE DETECTION

LocalVault

Understand duplicate files before you clean up.

LocalVault is a Python file intelligence and duplicate detection tool. It recursively scans directories, collects file metadata and identifies exact duplicates using SHA-256. Its reports estimate potentially recoverable disk space and can be exported as JSON or CSV. The tool never automatically deletes, modifies or moves user files.

Runs on
Python 3.10+
Repository created
View source on GitHub
README example
$ python3 main.py ~/Downloads --reports
# Excerpt from the README example
Files found         : 152
Total size          : 1.42 GB
Duplicate groups    : 3
Duplicate files     : 7
Recoverable space   : 185.31 MB
Excerpt from the documented README sample. These numbers illustrate a report, not your storage. Read the original example on GitHub, opens in a new tab.

What it does

  • Scan directories recursively and collect file metadata.
  • Group matching file sizes, then compare SHA-256 hashes.
  • Summarize file extensions and potentially recoverable storage.
  • Export results as JSON, CSV or both report formats.

Run the documented example

Run the example from the repository root, replacing ~/Downloads with a directory you want to inspect. The --reports option generates both JSON and CSV reports; --json and --csv select a single format. Generated reports are stored in reports/ by default. Use --show-files to list discovered files or --help to review the CLI options.

Review before removing anything

Recoverable space is an estimate based on duplicate content, not a recommendation to delete every copy. A duplicate may serve a useful purpose in a backup or separate project. Inspect the paths and context before making your own cleanup decisions. LocalVault operates in read-only mode and ignores development directories. Its generated JSON and CSV files are ignored by Git to help keep personal scan results out of commits.

Inside the code

Files are grouped by size first: uniquely sized files need no hash comparison. Matching-size files are hashed in chunks and grouped when their SHA-256 hashes also match. Chunked reading avoids loading an entire large file into memory. The repository separates scanning, hashing, duplicate detection and reporting, with automated tests and no external Python dependencies.