Prepare Google Photos Takeout exports for clean downstream import, archival, or verification.
prepare_google_photos_takeout.py is a small command-line utility that normalizes a Google Photos Takeout export so it is easier to import into another photo library or preserve as a clean archive.
The script does not modify the original Takeout tree. It copies media into a new output folder, restores timestamps from Google JSON sidecars or embedded metadata, normalizes file extensions to the detected file type, avoids filename collisions, and writes verification reports.
Google Photos Takeout exports often contain sidecar JSON files, truncated filenames, inconsistent extensions, and timestamps that do not transfer cleanly into other tools. This project rebuilds a safer output tree from that export without touching the original data.
- Install Python 3.10+ and
exiftool. - Run the script against one Takeout folder.
- Import or inspect the normalized output and generated reports.
python3 prepare_google_photos_takeout.py \
"Photos from 2021" \
"prepared-output/Photos from 2021" \
--media-only- matches Google Photos JSON sidecars back to the correct media file
- restores capture time from sidecar JSON when available
- falls back to embedded metadata or source file timestamps when needed
- normalizes output extensions to the detected real file type
- avoids output filename collisions after normalization
- optionally writes timestamps back into copied media files
- generates CSV and JSON reports for later verification
- supports
--verify-onlymode to validate a previously prepared output tree
- Python 3.10 or newer
exiftoolavailable inPATHrsyncavailable inPATHif you use--backup-root
Prepare a Takeout folder into a new destination:
python3 prepare_google_photos_takeout.py \
"Photos from 2021" \
"prepared-output/Photos from 2021" \
--media-onlyVerify an existing prepared output using the generated report:
python3 prepare_google_photos_takeout.py \
ignored \
"prepared-output/Photos from 2021" \
--verify-onlyShow available flags:
python3 prepare_google_photos_takeout.py --helpThe script writes normalized media into the target folder and also creates report files next to that output using the base name from --report-name:
<report-name>.csv<report-name>.json
These reports capture the chosen timestamps, sidecar matching result, warnings, and verification details.
- Hidden files are ignored during inventory.
- The input folder can keep the original Google Takeout naming.
--media-onlyskips copying normalized JSON sidecars.--no-write-metadatakeeps the copied file mtime update but skips embedded metadata writes.
MIT