Skip to content

PinLin/prepare_google_photos_takeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

prepare_google_photos_takeout

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.

Why

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.

Quick Start

  1. Install Python 3.10+ and exiftool.
  2. Run the script against one Takeout folder.
  3. 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

What It Does

  • 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-only mode to validate a previously prepared output tree

Requirements

  • Python 3.10 or newer
  • exiftool available in PATH
  • rsync available in PATH if you use --backup-root

Usage

Prepare a Takeout folder into a new destination:

python3 prepare_google_photos_takeout.py \
  "Photos from 2021" \
  "prepared-output/Photos from 2021" \
  --media-only

Verify an existing prepared output using the generated report:

python3 prepare_google_photos_takeout.py \
  ignored \
  "prepared-output/Photos from 2021" \
  --verify-only

Show available flags:

python3 prepare_google_photos_takeout.py --help

Output

The 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.

Notes

  • Hidden files are ignored during inventory.
  • The input folder can keep the original Google Takeout naming.
  • --media-only skips copying normalized JSON sidecars.
  • --no-write-metadata keeps the copied file mtime update but skips embedded metadata writes.

License

MIT

About

Prepare, normalize, and verify Google Photos Takeout exports for downstream import or archival use.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages