This repository contains some scripts that helped me deduplicate thousands of events that got created when I imported my calendar to Fastmail.
The scripts have the same requirements as described in the Google Calendar Quickstart example
- Python 2.6 or greater
- The pip package management tool
- A Google Cloud Platform project with the API enabled
- Authorization credentials for a desktop application
- A Google account with Google Calendar enabled
- Install the necessary libraries by running
pip install -r requirements.txt
insrc
- Generate an OAuth Client ID for a Desktop Application and save the file as
credentials.json
in the same path as the scripts - Run any of the scripts in
src
Since this is a quick and dirty hack for myself there are some caveats:
- Duplicate events are simply matched by a prefix that Fastmail added to their events, replace it with the prefix that was added to your events
- There is a very annoying and possibly undocumented rate limit on the number of requests you can fire in a - unknown to me - timespan, maybe due to the app being in Test-mode when I generated the OAuth credentials
I have no intention to maintain or troubleshoot this code: I published it because it helped me fix my problem and it might help someone else.
The authentication parts of the code were mostly taken from Google's quick-start example