Skip to main content

A library that sorts Google Takeout Photos by their creation date with metadata preserved.

Project description

 ██████╗ ██████╗ ████████╗████████╗
██╔════╝ ██╔══██╗╚══██╔══╝╚══██╔══╝
██║  ███╗██████╔╝   ██║      ██║   
██║   ██║██╔═══╝    ██║      ██║   
╚██████╔╝██║        ██║      ██║   
 ╚═════╝ ╚═╝        ╚═╝      ╚═╝   
----------------------------
                  google photos takeout toolkit                  

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

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. That makes it extremely difficult to find a corresponding JSON metadata file.

Roadmap

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gphotos_takeout_toolkit-0.3.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gphotos_takeout_toolkit-0.3.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file gphotos_takeout_toolkit-0.3.0.tar.gz.

File metadata

  • Download URL: gphotos_takeout_toolkit-0.3.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for gphotos_takeout_toolkit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e564d6c338c4fbe5747c17b572195591dbafb7c7759d9e5b7d93ecdc16cb96fa
MD5 f5f34ca8c7bf22518309153e22ce7db7
BLAKE2b-256 28a88628906653cfa4602a6227fb1521463e868b40c43dba6cccc651772f19a5

See more details on using hashes here.

File details

Details for the file gphotos_takeout_toolkit-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: gphotos_takeout_toolkit-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for gphotos_takeout_toolkit-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a0276a61a73b78ed38e32b53f2246854eff5e6a6cf8cfa0d9f47b3e0e94db39
MD5 95daae404935e48c4ecd555aecc4b799
BLAKE2b-256 a1639eee0d78c341e65c51f37bbbaf91a9ac55f5e172f5ae97a112125b086b8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page