The File Organizer is a simple application that helps users automatically sort and organize files within a selected directory based on predefined file type mappings. It provides a GUI for selecting the directory and categorizes files into subfolders based on their extensions.
- The application runs on Windows.
- Python must be installed on your system.
- Download and save the script to your local system.
- Ensure you have Python installed (recommended version: 3.7 or later).
The file type mappings must be defined in a JSON configuration file (file_mapping.json)
Example configuration:
{
"Images": [".jpg", ".png", ".gif"],
"Documents": [".pdf", ".docx", ".txt"],
"Videos": [".mp4", ".avi", ".mkv"]
}Each key represents a folder name, and its associated list contains file extensions that should be moved into that folder.
- Run script python file_organizer.py
- A GUI window will prompt you to select a directory to organize.
- The application will scan the directory and move files into categorized folders based on the mappings in
file_mapping.json. - A log file (
logs.log) will be maintained at%LOCALAPPDATA%/FileOrganizerfor tracking file movements and errors.
- If the configuration file is missing, a notification will be shown.
- If the configuration file contains invalid JSON, an error message will be displayed.
- If the selected directory does not exist, the user will be notified.
All actions and errors are logged in:
logs.log
Log messages include:
- Information about moved files.
- Warnings for missing configuration.
- Errors for invalid directories.
For any issues or enhancements, update the file_mapping.json file accordingly or check the logs for debugging information.