File Organizer App

By Maria D. Campbell

Monday, August 3, 2026 at 10:19 PM | 1 min read

Last modified on Monday, August 3, 2026 at 10:19 PM

$stack:python3/os/shutil/glob/modularization/project

Photo by Cup of Couple on pexels.com

This is a small Python3 command-line script that organizes files into folders based on their extension. Point it at a directory, and it sorts everything inside into extension-named folders: .py files go into python-files, .jpg files go into jpg-files, and so on, for a few dozen extensions covering text, code, media, and archive formats.

The project is intentionally modularized. The extension-to-folder mapping lives in its own extensions.py file as a dictionary, separate from the file_organizer.py script that does the actual work. file_organizer.py imports that dictionary, loops over each extension, creates the destination folder if it doesn't already exist, and uses the shutil and glob modules to find and move matching files.

Keeping the extension mapping separate from the logic that acts on it makes the dictionary easy to extend or reuse without touching the core script.

Running the application

Clone the repository and cd into it:

git clone https://github.com/interglobalmedia/file-organization-app.git cd file-organization-app

Open file_organizer.py and set the path variable to the directory you want organized:

path = r'/home/maria/Desktop'

Then run the script with:

python3 file_organizer.py

The script will create extension-named folders inside that directory as needed, and move each file into its matching folder. Set verbose = 0 in file_organizer.py if you'd rather not see each file move printed to the terminal.

loading