This Python script provides a simple file organizer that categorizes files based on their types into designated folders. It classifies files into categories such as Images, Videos, Documents, and an "Other" category for files that do not match any predefined types.
- Organizes files into folders based on their types.
- Creates folders for each file type if they don't already exist.
- Logs the movement of each file to its corresponding folder.
- Clone the repository:
git clone https://github.com/josharsh/100LinesOfCode.git- Navigate to the project directory:
cd python-file-organizer- Run the script:
python organizer.pyThe script will automatically categorize files in the current directory and move them into the appropriate folders.
- Check the console output for information about the organization process.
You can customize the file types and their corresponding folders by modifying the file_types dictionary in the organizer.py script.
self.file_types = {
"Image": [".png", '.jpeg', '.jpg'],
"Video": ['.mp4', '.mkv', '.3gp', '.webp'],
"Document": ['.pdf', '.doc', '.docx', '.odf', '.odt', '.xlsx'],
"Other": []
}Python3.x
Feel free to report any issues or suggest improvements by creating a new issue or submitting a pull request.