A Python automation script that cleans up messy folders by organizing files into categorized subfolders based on their extensions.
Perfect for managing cluttered directories like Downloads, Desktop, or Documents.
- Automatically detects file types (
.pdf,.jpg,.zip, etc.) - Creates subfolders such as
pdf_files,jpg_files,zip_files - Moves each file into its respective folder
- Handles unknown or extensionless files by placing them in an
others_filesfolder - Safe β skips any existing folders
- Working with
osandshutilmodules - File system navigation and automation
- String manipulation and error handling
- Writing reusable functions and clean code
- Clone this repository
git clone https://github.com/CodingSelim/FileOrganizer.git cd FileOrganizer - Run the script
python file_organizer.py
- Enter the path of the folder you want to organize when prompted:
Enter the path of the folder to organize: /path/to/your/folder - Watch it automatically create folders like:
pdf_filesjpg_fileszip_filesothers_files
Moved: resume.pdf β /home/selim/Downloads/pdf_files
Moved: photo.png β /home/selim/Downloads/png_files
Moved: archive.zip β /home/selim/Downloads/zip_files- Python 3.x
- No external libraries required