The File Organizer is a Python script designed to organize files within a specified directory based on their file types. It helps maintain a structured and organized file system by categorizing files into folders according to their extensions.
-
Organize Files Script: The
organize_files.py
script scans the specified directory, categorizes files based on their extensions, and moves them into corresponding folders. It also generates a mapping file (mapping.json
) to track the changes. -
Revert Organization Script: The
revert_organize_files.py
script uses the mapping file to revert the changes made by the organization script, restoring the original file structure.
-
Installation:
-
Clone the repository:
git clone https://github.com/kunal232i/File-Organizer.git
-
Navigate to the project directory:
cd File-Organizer
-
-
Organize Files:
python organize_files.py <directory_path>
- Replace
<directory_path>
with the path of the directory you want to organize.
- Replace
-
Revert Organization:
python revert_organize_files.py <directory_path>
- Replace
<directory_path>
with the path of the directory you want to revert.
- Replace
Organizing files in the example_directory
:
python organize_files.py example_directory
Reverting the organization in the example_directory
:
python revert_organize_files.py example_directory
- The mapping of the file structure is stored in
mapping.json
. - If files are accidentally organized, the revert script can be used to restore the original structure.