Command-line tools for organising photos by date, managing RAW/JPG pairs, and optimising images.
- RAW: .raf
- JPG: .jpg, .jpeg
This project depends on external system tools in addition to Python.
Used for extracting image metadata (including RAW formats).
- Supports all major image formats, including RAW
- Provides consistent metadata fields across formats
- More reliable than Python-only EXIF libraries
If exiftool is not installed, the CLI will fail with a clear error message and exit code 1.
Install (macOS)
brew install exiftoolOn Linux, install via your package manager (e.g. apt install exiftool).
pipx install photo-tools-cliInstalls the CLI in an isolated environment and makes photo-tools available globally, avoiding dependency conflicts.
pip install photo-tools-cliClone the repository and install:
pip install -e .
pip install --group dev -e .List available commands:
photo-tools --helpEach command provides detailed usage, including arguments and options:
photo-tools <command> --helpNote: All commands currently process files in the top-level input directory only.
All commands support:
--dry-run— preview changes without modifying files--verbose/-v— show per-file output
Flags can be combined:
photo-tools <command> ... --dry-run --verbose- Organise images into date-based folders (
YYYY-MM-DD, optional suffix) - Files are moved (not copied) into the output directory
- If a destination file already exists, it is skipped (no overwrite)
photo-tools by-date <INPUT_DIR> <OUTPUT_DIR>photo-tools by-date <INPUT_DIR> <OUTPUT_DIR> --suffix <SUFFIX>- Move RAW images into a
raws/subfolder within the input directory - Non-RAW files are left unchanged
- Files are moved (not copied) in place
- If a destination file already exists, it is skipped (no overwrite)
photo-tools raws <INPUT_DIR>- Move RAW files to
raws-to-delete/if no matching JPG (same prefix) exists - Matching is based on filename prefix (e.g.
abcd.RAFmatchesabcd_edit.jpg) - Files are moved (not deleted), making the operation reversible
photo-tools clean-raws <RAW_DIR> <JPG_DIR>- Resize images to a maximum width of
2500px - Choose the highest quality that results in a file size ≤
500 KB(never below70%) - Saves optimised images with prefix
lq_in the same directory (overwrites existing files)
photo-tools optimise <INPUT_DIR>For convenience during development, you can create a local structure:
mkdir -p data/input data/outputPlace test photos in:
data/input/
You can run the CLI module directly for testing:
python -m photo_tools.cli by-date ./data/input ./data/outputThis project uses pytest:
pytestCommon development tasks are available via the Makefile.