FileSwapper is a Python-based utility for managing and automating file operations like copying files to specific directories and subdirectories based on configuration. It supports features like filtering, directory traversal, and colored console output for better user experience.
- Configuration-Driven 🛠️: Define file operations in a JSON configuration file.
- Selective Copying ✅: Copy files only if they are newer than the existing ones.
- Directory Traversal 📂: Traverse directories up to a specified depth.
- Colored Output 🎨: Display messages in different colors for better readability.
- File Selection 🔍: Interactive file selection from directories.
- Utility Functions 🔧: Includes reusable utilities for file operations.
-
Clone the repository:
git clone https://github.com/tf4482/fileswapper.git cd fileswapper -
Install the required dependencies:
pip install -r requirements.txt
-
Create a configuration file based on
example.config.json:{ "file_pairs": [ { "source_file": "path/to/source/file.txt", "target_dir": "path/to/target/directory", "depth": 2 } ] } -
Run the script:
python fileswapper.py
-
Follow the on-screen instructions to manage your file operations.
fileswapper/
├── utils_python/ # Utility modules for file operations
│ ├── colored_text.py # Colored console output
│ ├── convert_to_string.py # Data conversion utilities
│ ├── copy_files.py # File copying logic
│ ├── directory_traversal.py # Directory traversal logic
│ ├── list_files.py # File listing utility
│ ├── select_file.py # Interactive file selection
│ └── __init__.py # Package initializer
├── fileswapper.py # Main script
├── example.config.json # Example configuration file
├── .gitignore # Git ignore rules
├── README.md # Project documentation
└── LICENSE # License file
Contributions are welcome! Feel free to open issues or submit pull requests to improve this project.
This project is licensed under the MIT License. See the LICENSE file for details.