Skip to main content
 ██████╗ ██████╗ ████████╗████████╗
██╔════╝ ██╔══██╗╚══██╔══╝╚══██╔══╝
██║  ███╗██████╔╝   ██║      ██║   
██║   ██║██╔═══╝    ██║      ██║   
╚██████╔╝██║        ██║      ██║   
 ╚═════╝ ╚═╝        ╚═╝      ╚═╝   
----------------------------
                  google photos takeout toolkit                  

PyPI Downloads

Table of Contents

Why did I create this?

Well, my parents asked me to move all of their google photos to an external SSD drive. I saw how many photos they had and didn't want to do it manually so I decided to create a library that will do it for me.

What does gphotos_takeout_toolkit do?

This library sorts photos from Google Takeout and merges their missing metadata. Metadata is exported along with the file and has almost the same name. Files are moved according to this convention:

├── Your destination folder
    ├── videos
        ├── user (you could name it however you want, it sets to `user` folder by default)
            ├── photos_from_2024_11_05_by_user
                ├── photo.jpg

How to run?

Prerequisites

To be able to use this library, you need to have ExifTool installed on your machine as that is the required tool to restore metadata. Library checks whether you have it installed or not.

Windows/Mac

https://exiftool.org

Ubuntu

sudo apt install libimage-exiftool-perl

CentOS/RHEL

yum install perl-Image-ExifTool

Arch

sudo pacman -S perl-image-exiftool

Dependencies

Installation

To use gphotos_takeout_toolkit, you will need python 3.11+ (earlier versions will not work due to the lack of support).

Create a virtual environment:

python -m venv .venv
source ./.venv/bin/activate

From PyPi

Pip installation:

pip install gphotos_takeout_toolkit

Uv installation:

uv add gphotos_takeout_toolkit

From source

Clone the project on your local machine:

https://github.com/joludyaster/gphotos_takeout_toolkit.git

Run:

pip install .

And to make sure that everything is fine, run these commands to check whether the library has all needed dependencies:

gphotos_takeout_toolkit --help
python -m gphotos_takeout_toolkit

CLI

Main

Usage: gphotos_takeout_toolkit [OPTIONS] COMMAND [ARGS]...

Options:
    --version, -V                   Show version and exit.                                                                                                                                                                       │                                                                                                      │
    --help                          Show this message and exit.   

Commands:
    organize                        Command to sort, organize and 
                                    merge metadata of the files.
                                    
Examples:
    gphotos_takeout_toolkit --version                        
    gphotos_takeout_toolkit --V

Organize

Usage: gphotos_takeout_toolkit organize [OPTIONS] INPUT_PATH DESTINATION_PATH

Options:
    --owner-name, -o                TEXT  Owner of the folders. [default: user]                                                                                                                                                  │
    --additional-file-move, -a      Additionally move all files into one folder.                                                                                                                                           │
    --enable-verbosity, -v          Enable verbosity to see all the logs in the console.                                                                                                                                   │
    --help                          Show this message and exit. 

Examples:
    gphotos_takeout_toolkit organize input_path destination_path -o jack -a -v
    gphotos_takeout_toolkit organize input_path destination_path --owner-name jack --additional-file-move --enable-verbosity
    gphotos_takeout_toolkit organize input_path destination_path -a -v

Metrics

Here I've performed some of the tests to see how long it takes to organize the files:

Source Size Number of files Time
folder 26.9GB 1501 ~33m

Edge cases

While the library handles majority of the tricky situations, there are moments where it's simply impossible to move or get a metadata for the file.

Here are some of the reasons:

  • Not a valid JPG (looks more like a RIFF) - means that an actual type of the file is not supported by ExifTool, usually it's Webp.
  • When a file name looks like this Screenshot_2023-10-16-21-47-42-334_com.zhiliaoa.jpg or B5RjaEjPAEjbhnWhlB9JEJoo9M7dvFU-EmZgZseQH1kHdcC.jpg, google either strips the names or replaces some of the characters in the file name. Since this library iterates through JSON files first, it won't find a corresponding filename, therefore it won't be moved.

Roadmap

  • Merge metadata and a file that's being moved.
  • Allow users to modify how the folders are made and what structure to follow.

Metadata

Release files for gphotos_takeout_toolkit 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gphotos_takeout_toolkit 0.4.1
File Size Uploaded Provenance Actions
gphotos_takeout_toolkit-0.4.1.tar.gz 17.0 kB Without provenance Details for gphotos_takeout_toolkit-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gphotos_takeout_toolkit 0.4.1
File Interpreter ABI Platform Actions
gphotos_takeout_toolkit-0.4.1-py3-none-any.whl Python 3 none any Details for gphotos_takeout_toolkit-0.4.1-py3-none-any.whl

Total release size: 31.6 kB

Release files / gphotos_takeout_toolkit-0.4.1.tar.gz

Download URL gphotos_takeout_toolkit-0.4.1.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
74ffbb7016df6eba97e9eb07ea1498fde3aea9fe941ec3e9166cba7c8b7885e8
BLAKE2b-256 checksum
How to use checksums
1b379d60d49daf03424d276a52d12cc47b0963b9474f97f7bb273633298adc03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / gphotos_takeout_toolkit-0.4.1-py3-none-any.whl

Download URL gphotos_takeout_toolkit-0.4.1-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9f63f5f70e01ecb8e9aec9cc66d90d5501748d740b962993235aeb7bf57bcc4
BLAKE2b-256 checksum
How to use checksums
c32d3e7cd64fd501e9f3bdb680b02e29fc9d53ac7ccd1b50d866ead2f23bed97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for gphotos_takeout_toolkit 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page