This Python script helps you organize your files by categorizing them based on their extensions. It automatically moves files and folders into pre-defined categories as specified in a filetypes.json file. The script uses a graphical file dialog to select the folder to organize.
- Automatically sorts files based on their extensions.
- Moves files into categorized folders (e.g., documents, images, scripts).
- Organizes unorganized folders into a
foldersdirectory. - User-friendly interface with a file dialog for selecting directories.
- Customizable file categories via
filetypes.json.
- Python 3.x
tkinter(usually included in Python installations)jsonshutil
- Clone this repository or download the script files to your computer.
- Make sure you have Python 3 installed.
- Install any dependencies (though
tkinterand other libraries are usually pre-installed with Python).
-
Prepare
filetypes.json: Create or modify afiletypes.jsonfile to define the file types and their categories. For example:{ "documents": [".pdf", ".docx", ".txt"], "images": [".jpg", ".png", ".gif"], "scripts": [".py", ".sh", ".bat"], "audio": [".mp3", ".wav"] } -
Run the script:
- Run the script using the command line or an IDE.
- A file dialog will open, allowing you to select the folder you wish to organize.
- The script will sort the files and move them into the appropriate directories based on the file extensions.
python main.py
-
Sorting: The script will:
- Create folders for each file category defined in
filetypes.json. - Move files into the appropriate folders.
- Place any unorganized folders into a
foldersdirectory.
- Create folders for each file category defined in
{
"documents": [".pdf", ".docx", ".txt", ".xlsx"],
"images": [".jpg", ".png", ".gif", ".bmp"],
"audio": [".mp3", ".wav"],
"scripts": [".py", ".sh", ".bat"]
}This project is licensed under the MIT License - see the LICENSE file for details.
This project was created and maintained by po1sontre.