takeout_prepper 0.0.3
Prepares Google Takeout exports for ingestion into other tools and fixes small issues
License: MIT
Requires Python: >=3.12

# Takeout Prepper

Prepares Google Takeout exports for ingestion into other tools. These commands come without any form of warranty. Your mileage may vary depending on the source data and the tool that will be ingesting the cleaned data.


## For Google Calendar exports

To prep a Google Calendar export, run `prep-google-calendar input.ics output.ics`.

Note: it appears that exports generated by Google Takeout are sometimes more complete than the ones exported directly from Google Calendar. Google Takeout exports may include items you recently deleted and mark them as cancelled events.

The following modifications are applied:

- Events with a creation date of `00010101T000000Z` cannot be parsed by some tools. Therefore they are updated to `19700101T000000Z`.
- Events with a reminder that doesn't contain an action (`ACTION:NONE`) may not trigger a reminder in some tools. Therefore the action is updated to `ACTION:DISPLAY`.
- For an unknown reason, events may be exported with a reminder time of the oddly specific `19760401T005545Z`. The script's working assumption is that no one will travel back to 1976 to be reminded of future events, so those triggers are changed to 10 minutes before the start of the event.


## For Google Tasks exports

To prep a Google Tasks export, run `prep-google-tasks --tz=Europe/Madrid input.json output.ics`.

Tasks are output in JSON format. Most tools can only ingest in ICS format, a file format that supports to do items. You will need to provide the timezone you use your task list in to get the timestamps to show correctly in some tools.

At least at the time of writing, Google Takeout did not expose information about task recurrence. You will need to manually add this information again. A recurring task will show up as a regular task **only once**, unless a recurrence of it appears in your completed tasks. In that case it **will not show up at all**. To avoid losing recurring tasks completely, you may want to delete your completed tasks before making an export.


## For Google Photos exports
Ensure `exiftool` is installed on your system first. To prep a Google Photos export, run `prep-google-photos inputfolder outputfolder`. The following will happen:

- Date taken and location coordinate metadata will be read from the accompanying metadata
- The metadata will be added to your images and videos using `exiftool`
- JPG and QuickTime videos are supported
- PNGs will be converted to JPGs first
- Mimetype sniffing is used to correct file extension inconsistencies
- Timezone information will be included in metadata that is written to your files. It will be inferred from your photos where possible, with a fallback on your system's timezone if not available. This should only affect the representation of the timestamp. If no other information is available, a photo taken at 12am UTC for example should be stored as 2am Eastern European Time for a photo taken outside daylight savings time if you live in Greece.
- Some file corruption tolerance exists
- Certain types of files may be passed on as-is if no explicit support for them is available (looking at you, 3gp)
- Video footage taken while making photos to use the 'best shot' feature might get excluded from the output folder

If you want more information about what's happening during the prep process, enable `--verbose`.