Skip to content

KanekiEzz/photo-organizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Έ Photo & File Organizer

🐳 Docker-powered file organizer that automatically sorts your media library

Docker Python License

Data Analyst Associate Certification


✨ What It Does

Automatically organizes your messy files into a clean, structured hierarchy based on:

  • πŸ“‚ Category β†’ Photo, Video, Document, Audio, Other
  • πŸ“… Year β†’ Extracted from file modification date
  • πŸ—“οΈ Month β†’ Organized by month number

🎯 Example Output

πŸ“ Your Folder
β”œβ”€β”€ πŸ“Έ Photo/
β”‚   └── 2024/
β”‚       └── 01/
β”‚           └── vacation.jpg
β”œβ”€β”€ 🎬 Video/
β”‚   └── 2023/
β”‚       └── 12/
β”‚           └── birthday.mp4
└── πŸ“„ Document/
    └── 2025/
        └── 02/
            └── invoice.pdf

✨ Bonus: Works recursively β€” finds files buried deep in subfolders!


πŸš€ Quick Start

1️⃣ Build the Docker Image

make build

2️⃣ Organize Your Files

make run PATH_TO_SORT=/path/to/your/folder

Example:

make run PATH_TO_SORT=/media/kanekiezz/photo

3️⃣ Optional: Interactive Shell

Want to explore inside the container?

make bash

4️⃣ Cleanup

Remove the Docker image when done:

make clean

🎯 Features

Feature Description
πŸ” Smart Detection Auto-categorizes files by extension
πŸ“… Date-Based Sorting Organizes by file modification time
πŸ”„ Recursive Scanning Finds files in all subfolders
πŸ›‘οΈ Safe Operation Never overwrites existing files
πŸ—οΈ Auto-Create Folders Builds folder structure automatically
🐳 Dockerized Run anywhere without dependencies
🎨 Multi-Format Supports 25+ file types

πŸ“‹ Supported File Types

πŸ“Έ Photos

jpg, jpeg, png, gif
bmp, tiff, webp, heic

🎬 Videos

mp4, mov, avi, mkv
flv, wmv

πŸ“„ Documents

pdf, doc, docx, txt
xlsx, xls, ppt, pptx

🎡 Audio

mp3, wav, aac
flac, ogg

πŸ“¦ Everything else goes into the Other/ category


🧠 How It Works

graph LR
    A[πŸ“ Input Folder] --> B{Scan Files}
    B --> C[Detect Type]
    C --> D[Read Date]
    D --> E[Create Path]
    E --> F[Move File]
    F --> G[βœ… Organized!]
Loading
  1. Scans your folder recursively
  2. Detects file type by extension
  3. Reads modification timestamp
  4. Creates folder structure: Category/Year/Month/
  5. Moves file to organized location
  6. Skips already-organized folders

πŸ“– Usage Examples

Using Make (Recommended)

# Show help
make usage

# Build and run in one command
make build && make run PATH_TO_SORT=/media/kanekiezz/photo

Using Docker Directly

docker build -t photo-sorter .
docker run --rm -v /path/to/folder:/data photo-sorter /data

Using Python Directly (No Docker)

python organize.py /path/to/folder

🎨 Before & After

Before 😰

messy_folder/
β”œβ”€β”€ IMG_1234.jpg
β”œβ”€β”€ random_folder/
β”‚   β”œβ”€β”€ old_video.mp4
β”‚   └── nested_folder/
β”‚       └── document.pdf
└── vacation.mov

After 😌

messy_folder/
β”œβ”€β”€ Photo/
β”‚   └── 2024/
β”‚       └── 06/
β”‚           └── IMG_1234.jpg
β”œβ”€β”€ Video/
β”‚   β”œβ”€β”€ 2024/01/
β”‚   β”‚   └── vacation.mov
β”‚   └── 2023/12/
β”‚       └── old_video.mp4
└── Document/
    └── 2024/05/
        └── document.pdf

βš™οΈ Configuration

Edit the organize.py script to customize:

  • πŸ“ Add more file extensions
  • 🎨 Change category names
  • πŸ“ Modify folder structure
  • πŸ”§ Adjust behavior

πŸ› οΈ Makefile Reference

make build    # Build Docker image
make run      # Run organizer (requires PATH_TO_SORT)
make bash     # Open interactive shell
make clean    # Remove Docker image
make usage    # Show usage instructions

🀝 Contributing

Contributions welcome! Feel free to:

  • πŸ› Report bugs
  • πŸ’‘ Suggest features
  • πŸ”§ Submit pull requests

πŸ“œ License

MIT License β€” Free to use, modify, and distribute.


πŸ’‘ Pro Tips

  • βœ… Run on a copy first to test behavior
  • πŸ”„ Already organized? The script skips Photo/Video/Document/Audio/Other folders
  • πŸš€ Large libraries? Docker ensures consistent performance
  • πŸ“Š Want logs? Add verbosity to the Python script

Made with ❀️ for organized people

⭐ Star this repo if it helped you!

Releases

No releases published

Packages

 
 
 

Contributors