Skip to content

audzeimar/python-file-organizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

File Organizer (Python)

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.


Features

  • 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

Technologies

  • Python
  • pathlib – for working with file paths
  • shutil – for moving files

Project Structure

file-organizer/
│
├── organizer.py
├── README.md
└── example_files/

How It Works

  1. The user provides a path to a folder.
  2. The script scans all files in the folder.
  3. Based on file extensions, it determines the appropriate category.
  4. The script creates category folders if needed.
  5. Files are moved to their corresponding folders.

Example categories:

  • images
  • documents
  • audio
  • video
  • archives
  • code
  • other

Running the Program

Run the script from the terminal:

python organizer.py

Then enter the path to the folder you want to organize.

Example:

Enter folder path: ./example_files

Example

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

Learning Goals

This project demonstrates:

  • working with the file system in Python
  • basic automation scripts
  • organizing code into reusable functions
  • simple command-line interaction

Author

Created as a small Python project for practicing automation and file system operations.

About

A simple Python script that automatically organizes files in a folder by grouping them into categories based on file extensions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors