Skip to main content

A utility for safely merging multiple folders while handling file conflicts

Project description

Folder Merger

A Python utility for safely merging multiple folders while handling file conflicts intelligently.

Features

  • Recursively merges folders while preserving directory structure
  • Detects and handles file conflicts automatically
  • Skips duplicate files using MD5 hash comparison
  • Progress tracking with tqdm
  • Comprehensive logging

Installation

pip install folder-merger

Usage

Command Line Interface

folder-merger --source /path/to/source --destination /path/to/destination

Python API

from folder_merger import MergeManager

manager = MergeManager(
    source_root="/path/to/source",
    output_path="/path/to/destination"
)
manager.merge_all()

How it Works

  1. The tool recursively walks through the source directory
  2. For each file:
    • Checks if file exists in destination
    • If file exists, compares MD5 hashes to detect duplicates
    • If files are different, creates a conflict copy with "_conflict" suffix
    • If file doesn't exist, copies it to destination

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

folder_merger-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

folder_merger-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file folder_merger-0.1.0.tar.gz.

File metadata

  • Download URL: folder_merger-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for folder_merger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ac49b6374848f9a59b36b42229249e361537e3c56ab804843bc1b9fa74ce7805
MD5 777c7a03fcdae8892994a5e4fa8138f3
BLAKE2b-256 88f7d447d120d40f525d6e0834a3bab1816b9e23b5a9da3c0c6190d046f334a2

See more details on using hashes here.

File details

Details for the file folder_merger-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: folder_merger-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for folder_merger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68d3ebf5cb858e16ee5d032e17a4d1291000c5e2d35df89f316746ec2d8f7901
MD5 68e75e2f4ce9a70c081e9aaf5349cfb3
BLAKE2b-256 a874f3e1c5fb4138ad2d510f5a56f374d3cbe2b8e9aebcdf0ee471e95f02c10f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page