The organize-photos
is a Python CLI program that allows you to organize your photos into subfolders based on their EXIF metadata. You can define a custom pattern to create new paths for your photos, making it easy to sort and categorize your image collection.
- Organize photos based on EXIF metadata such as date and time taken.
- Customize the path structure using a template with placeholders for year, month, day, hour, minute, and second.
- Copy and rename images to the destination directory, maintaining the folder structure specified by the template.
- Supports UNIX-style glob patterns for selecting files in the source directory.
Prerequisites: pdm for environment management
- Clone this repository.
git clone https://github.com/ohmycoffe/organize-photos.git
- Navigate to the project directory.
cd organize-photos
- Install the required dependencies using pdm.
pdm install -G dev
Install pre-commit.
pdm run pre-commit install
- Run tests.
pdm run pytest
NOTE: This repository supports also GNU Make commands
make help
You can easily install the latest released version using binary installers from the Python Package Index (PyPI):
pip install organize-photos --user
source-dir
: The source directory containing the photos you want to organize.-d, --dest-dir
: The destination directory where copied and renamed images will be saved. If not provided, the default is the current working directory.-t, --template
: The template for generating new file paths. Customize the path structure using placeholders such as${year}
,${month}
,${day}
,${hour}
,${minute}
, and${second}
.-p, --file-pattern
: The pattern for selecting files in the source directory. Use UNIX-style glob patterns to filter which files will be processed. The default is to process all files.
organize-photos /path/to/source/photos -d /path/to/output -t "${year}/${year}${month}${day}${hour}${minute}${second}"
This command will organize the photos in the source directory based on the specified template and file pattern and save the organized photos in the destination directory.
For instance, if you have a file located at /path/to/source/photos/image1.jpg
, which was created on January 3, 2019, at 20:54:12
, the program creates a copy of the file at /path/to/output/2019/20190103205412.jpg
following the specified pattern.
organize-photos
is released under the MIT License.
- ohmycoffe
- GitHub: ohmycoffe