Skip to content

RTrinkleDev/Python-downloads-organizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Downloads Folder Organizer

A simple Python automation script that scans your Downloads folder, identifies files by extension, and automatically sorts them into category folders (Images, Documents, Videos, Archives, Code, Installers, Other).

This project demonstrates:

  • File system navigation
  • Working with paths (os, os.path)
  • Moving files (shutil)
  • Dictionaries and helper functions
  • Tuple unpacking
  • Basic automation scripting

Features

  • Automatically creates category folders if they don't exist
  • Detects file extensions and assigns them to the correct category
  • Moves files into their category folders
  • Handles unknown extensions by placing them in an "Other" folder
  • Clean, readable code with helper functions

How It Works

  1. The script scans your Downloads directory.
  2. It extracts each file’s extension using os.path.splitext().
  3. A helper function (get_category) determines which category the extension belongs to.
  4. The script creates category folders if needed.
  5. Files are moved into their appropriate folders.

Running the Script

Follow these steps to run the organizer:

  1. Install Python 3.x on your system.
  2. Download or clone this repository.
  3. Open the script file "organizer.py".
  4. Update the DOWNLOADS_PATH variable to match your system’s Downloads folder path.
  5. Open a terminal or command prompt in the project folder.
  6. Run the script with: python organizer.py

Your Downloads folder will be sorted instantly.


Categories

You can customize the categories in the dictionary:

Anything not listed goes into "Others" folder.

EXTENSION_CATEGORIES = {
    "Images": [".jpg", ".jpeg", ".png", ".gif", ".heic"],
    "Documents": [".pdf", ".docx", ".txt", ".htm"],
    "Videos": [".mp4", ".mov"],
    "Archives": [".zip", ".rar"],
    "Code": [".cpp", ".java", ".py"],
    "Installers": [".exe", ".msi"],
}

About

A Python script that automatically organizes your Downloads folder by sorting files into category folders.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages