A simple Python tool that automatically organizes files in a folder by grouping them into categories based on their file extensions.
This project was created as a small utility script and a practice project for working with Python, file systems and basic automation.
- Automatically sorts files by extension
- Creates folders for file categories if they do not exist
- Supports common file types such as images, documents, audio and video
- Prevents overwriting files by renaming duplicates
- Simple command-line interface
- Python
pathlib– for working with file pathsshutil– for moving files
file-organizer/
│
├── organizer.py
├── README.md
└── example_files/
- The user provides a path to a folder.
- The script scans all files in the folder.
- Based on file extensions, it determines the appropriate category.
- The script creates category folders if needed.
- Files are moved to their corresponding folders.
Example categories:
- images
- documents
- audio
- video
- archives
- code
- other
Run the script from the terminal:
python organizer.pyThen enter the path to the folder you want to organize.
Example:
Enter folder path: ./example_files
Before running the script:
example_files/
photo.jpg
notes.txt
music.mp3
script.py
After running the script:
example_files/
images/photo.jpg
documents/notes.txt
audio/music.mp3
code/script.py
This project demonstrates:
- working with the file system in Python
- basic automation scripts
- organizing code into reusable functions
- simple command-line interaction
Created as a small Python project for practicing automation and file system operations.