File Organizer

Welcome to the File Organizer page.

This page contains a brief description and implementation instructions for the project.

Project Description

Automatically sorts files in a directory into folders by their file type/extension. For example, all .jpg and .png images go into an “Image” folder, documents into “Docs”, etc. This helps clean up directories by moving files based on a predefined mapping of extensions to folders.

Project Requirements

Python 3.x (built-in os and pathlib modules).

How to Run the Project

  1. Write a script (e.g. organizer.py) that scans the current folder using os.scandir() and sorts files into subfolders (creating them with os.makedirs() as needed).
  2. Place the script in the directory you want to organize, or modify it to point to a target directory.
  3. Run it: python organizer.py. The files will be moved to corresponding folders based on their extensions.

Key Concepts Learned

Possible Extensions

Extend mapping to more file types; handle nested subdirectories recursively; allow the user to specify categories at runtime; add a “dry run” mode that shows what would happen without moving files; implement a GUI file chooser.

Troubleshooting & Debugging

See Troubleshooting & Debugging.

← Back to Python Programming Page