# 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

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.

To execute, run `prep-google-calendar input.ics output.ics`.


## For Google Tasks exports

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.

To execute, run `prep-google-tasks --tz=Europe/Madrid input.json output.ics`.
