Intelligent geotagging tool for PhotoPrism and local directories using Dawarich location data
Lazygeotag automatically adds GPS coordinates to your photos by matching their timestamps with location data from Dawarich. It supports both PhotoPrism queries and local directory scanning, with intelligent failure reporting and safe dry-run testing.
- Dual-mode operation: PhotoPrism queries and local directory scanning
- Safe dry-run mode for testing without modifications
- Intelligent failure reporting with categorized reasons
- Robust PhotoPrism API integration with timeout handling
- Automatic rescan optimization with common path detection
- Comprehensive EXIF GPS coordinate injection
- Support for JPEG and TIFF files with PNG filtering
- Time-based location matching with configurable time windows
GitHub: streiman/lazygeotag
- Python 3.8+
- PhotoPrism instance (for PhotoPrism mode)
- Dawarich instance with location data
- Required Python packages:
requests,piexif,pytz
git clone https://github.com/streiman/lazygeotag.git
cd lazygeotag
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your PhotoPrism and Dawarich credentials# Dry-run to see what would be processed
python lazygeotag.py --query "album:vacation" --dry-run
# Process photos from specific album
python lazygeotag.py --query "album:vacation year:2024"
# Process with custom time window
python lazygeotag.py --query "geo:false" --time-window 30# Process local directory (dry-run)
python lazygeotag.py --local-dir "/path/to/photos" --dry-run
# Process with automatic PhotoPrism rescan
python lazygeotag.py --local-dir "/path/to/photos" --rescanCreate a .env file with your credentials:
PHOTOPRISM_URL=http://your-photoprism-instance:2342
PHOTOPRISM_USERNAME=your-username
PHOTOPRISM_PASSWORD=your-password
DAWARICH_URL=http://your-dawarich-instance:3000
DAWARICH_API_KEY=your-api-key- Non-destructive testing with
--dry-runmode - Automatic PhotoPrism rescans after geotagging
- Intelligent batch processing with progress reporting
- Robust error handling for large photo collections
- Time zone aware location matching
- Detailed failure analysis to understand why photos weren't geotagged
The tool seamlessly integrates with PhotoPrism by:
- Using PhotoPrism's search API to find photos
- Downloading and processing photos in batches
- Updating EXIF data with GPS coordinates
- Triggering intelligent rescans of modified folders
- Providing detailed progress and failure reports
Perfect for PhotoPrism users who want to automatically geotag their photo collections using location data from Dawarich or similar services.