Skip to content

About

A Python automation tool that organizes JPG and JPEG image files into a separate folder.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

CodeAlpha Image File Organizer

A simple Python automation tool developed as part of my CodeAlpha internship.

Project Description

This project automates the process of organizing image files in a folder.

The program searches for .jpg and .jpeg files and automatically moves them into a separate JPG_Files folder.

This saves time and reduces the need to manually organize image files.

Features

  • Automatically finds .jpg files
  • Automatically finds .jpeg files
  • Creates a JPG_Files folder automatically
  • Moves image files into the destination folder
  • Prevents duplicate files from being overwritten
  • Displays the files that were moved
  • Shows the total number of files moved
  • Handles invalid folder paths
  • Informs the user when no image files are found

Technologies Used

  • Python
  • os module
  • shutil module

Concepts Used

  • Functions
  • if / elif / else
  • for loop
  • input()
  • print()
  • Variables
  • Lists
  • String methods
  • File and folder handling
  • File extensions
  • Conditional statements

How It Works

Suppose the selected folder contains:

TestFiles/
├── photo1.jpg
├── photo2.jpeg
├── document.pdf
└── notes.txt

After running the program:

TestFiles/
├── document.pdf
├── notes.txt
└── JPG_Files/
    ├── photo1.jpg
    └── photo2.jpeg

The program automatically creates the JPG_Files folder and moves the JPG/JPEG images into it.

How to Run

1. Make sure Python is installed

You can check by running:

python --version

2. Open the project in VS Code

Open the project folder containing:

file_organizer.py
README.md

3. Open the terminal

In VS Code, select:

Terminal → New Terminal

4. Run the program

python file_organizer.py

5. Enter the folder path

When prompted, enter the path of the folder you want to organize.

Example:

C:\Users\YourName\Desktop\TestFiles

Example Output

==================================================
       CODEALPHA IMAGE FILE ORGANIZER
==================================================
Enter the folder path: C:\Users\YourName\Desktop\TestFiles

Moved: photo1.jpg
Moved: photo2.jpeg

Successfully moved 2 image file(s).

Internship Task

This project was completed as Task 2: Task Automation with Python Scripts as part of my CodeAlpha internship.

Author

Kashif Khan

About

A Python automation tool that organizes JPG and JPEG image files into a separate folder.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages