A Python tool for organizing image and video files by date.
Language versions:
- English (default): README.md
- 中文: README_zh.md
- 日本語: README_ja.md
The program reads image EXIF time first. If EXIF time is unavailable, it falls back to the file's modified time.
Organized files are placed into the target directory using a year\month\day folder structure.
- Recursively scans subfolders in the source directory
- Organizes images and videos by date automatically
- Uses
movemode by default - Supports
copymode to keep original files - Supports Chinese, English, and Japanese UI
- Generates a separate log file for each run
- Automatically appends a numeric suffix for duplicate file names
.jpg.jpeg.png.mp4.mov
- Windows 10 or Windows 11
- Python 3.10 or later
- Dependency:
Pillow
Install dependency:
pip install PillowFor detailed environment setup, see:
Open a terminal in the project root and run:
python main.py --src SOURCE_DIR --dst TARGET_DIRExample:
python main.py --src D:\InputPhotos --dst D:\SortedPhotosSource directory. Required.
Destination directory. Required.
Organization mode:
move: move files, defaultcopy: copy files and keep originals
Example:
python main.py --src D:\InputPhotos --dst D:\SortedPhotos --mode copyInterface language:
zh: Chineseen: Englishja: Japanese
Default: en
Example:
python main.py --src D:\InputPhotos --dst D:\SortedPhotos --lang en
python main.py --src D:\InputPhotos --dst D:\SortedPhotos --lang japython main.py --src D:\InputPhotos --dst D:\SortedPhotospython main.py --src D:\InputPhotos --dst D:\SortedPhotos --mode copypython main.py --src D:\InputPhotos --dst D:\SortedPhotos --lang enpython main.py --src D:\InputPhotos --dst D:\SortedPhotos --lang jaThe program automatically creates or reuses the log folder under the script directory.
Log file names use this format:
organize_log_YYYYMMDD_HHMMSS.txt
Example:
organize_log_20260413_135222.txt
After execution, the program prints the full path of the generated log file.
- Recursively scans all subfolders in the source directory
- Uses image EXIF time first
- Falls back to file modified time when EXIF is unavailable
- Outputs files to
target\year\month\day\ - Adds a numeric suffix if a file with the same name already exists
Duplicate name example:
photo.jpg
photo_1.jpg
photo_2.jpg
main.pyProgram entry pointcore/Date detection and EXIF reading logicservices/File organization logiclocales/Chinese, English, and Japanese UI textslog/Log output folder for each run
- Make sure the source and destination paths are correct
- Default
movemode removes files from the source directory - Use
--mode copyif you need to keep original files - It is recommended to test with a small number of files first
- Back up important files before large batch processing
- File is in use and cannot be moved or copied
- File permission is insufficient
- Image EXIF data is invalid
- Destination directory is not writable
This tool is intended to automatically organize image and video files. In actual use, the result may still differ from expectations due to incorrect paths, permission problems, file locks, disk issues, invalid time metadata, interrupted execution, or other unforeseen factors.
Please note:
- Default
movemode moves original files - Duplicate file names are automatically renamed
- If EXIF time or file time is inaccurate, the destination date folder may not match the real capture date
- Logs are only for assistance and do not guarantee completeness of results
To reduce risk:
- Test with a small set of files first
- Prefer
--mode copyfor verification - Back up important data before full processing
- Check both the log and destination folders after execution
For the full disclaimer, see: