Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

File Organizer Script (Python)

A smart and lightweight Python automation script that automatically organizes your files into categorized subfolders based on their extensions. Say goodbye to messy "Downloads" folders — everything gets sorted neatly in seconds!


How It Works

1️⃣ You input the folder path you want to organize.
2️⃣ The script scans all files (ignoring subfolders).
3️⃣ It creates subfolders based on file types and moves files accordingly:

Category File Extensions
Images .jpg, .jpeg, .png, .gif, .bmp, .tiff
Documents .pdf, .doc, .docx, .txt, .xls, .xlsx, .ppt, .pptx
Audio .mp3, .wav, .aac, .flac
Videos .mp4, .mov, .avi, .mkv
Archives .zip, .rar, .tar, .gz, .7z
Scripts .py, .js, .html, .css, .sh, .bat
Others Any unrecognized file type

Files with unknown or uncommon extensions are moved into an “Others” folder.


Usage Guide

1️⃣ Clone this repository:

git clone https://github.com/mantrapatil03/python-beginner-friendly-projects.git
cd python-beginner-friendly-projects/file-organizer

2️⃣ Run the script:

python file_organizer.py

3️⃣ Enter your target folder path:

Enter the path of the folder to organize: /home/user/Downloads

✅ Done! Your files will now be automatically categorized into subfolders.

Example Output

Before:

Downloads/
├── photo1.jpg
├── song.mp3
├── document.pdf
├── script.py

After:

Downloads/
├── Images/
│   └── photo1.jpg
├── Audio/
│   └── song.mp3
├── Documents/
│   └── document.pdf
├── Scripts/
│   └── script.py

⚠️ Notes

  • This script moves files (does not copy).
  • Make sure you have write permissions for the directory.
  • Always test on a small sample folder first to verify results.

Author

Mantra Patil

💼 LinkedIn: https://www.linkedin.com/in/mantrapatil25

✉️ techmantrapatil@gmail.com

✨ If you found this useful, consider giving it a ⭐ on GitHub! ✨