Skip to content

tuckcodes/Google-Calendar-Cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

gcalcleanup

An easily modified Google Calendar Cleanup tool that can be ran locally via terminal

Note: The script will show you the results, and then ask you to proceed with deletion. It does NOT delete without permission first.

image

- Save as 'credentials.json' into your local repo

image

- Modify the following lines
service.events().delete(calendarId='<YOUREMAILHERE>', eventId=_eventId).execute()

calendarId='<YOUREMAILHERE>',

maxResults=10, # Change this number to retrive more total results

q='<CUSTOM QUERY STRING GOES HERE>'

  • Run the following
python gcalcleanup.py
  • The script will auto-generate a token.json file. If you are iterating with this script, sometimes you need to delete it as it stores scoping/permissions stuff and can hinder expected outcomes with code changes.

A successful run looks like this: Screenshot 2022-05-18 233222

Notes

If you have python errors, make sure you have python3 installed. If PATH isnt set, you can also try running:

python3 gcalcleanup.py

Things that can improve

  • Concurrent API calls

The script currently churns out about 1 call per second, or 60 per minute, due to its sequential nature. For smaler loads this may not be an issue, but some folks like myself may be dealing with thousands of events. The Google API quota is about 240 per minute limit, which means this could see a 3x or 4x increase in throughput with concurrent calls.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages