The Calendar Backup Tool is designed to back up your Google Calendar to Google Drive in JSON format. This tool utilizes the Google Calendar API to fetch calendar data and the Google Drive API to upload the backup files into a dedicated folder on Google Drive.
- Secure Authentication: Uses OAuth 2.0 for secure authentication with Google APIs.
- Backup All Calendars: Fetches all calendars from your Google account and saves them locally as JSON files.
- Automatic Upload to Google Drive: Automatically uploads backup files to a folder named
Calendar_Backups
in Google Drive. - Folder Creation: Creates the backup folder in Google Drive if it does not already exist.
- User-Friendly: Fully automated process after authentication.
- Enable Google Calendar API and Google Drive API in the Google Cloud Console.
- Download the OAuth 2.0 credentials file (
credentials.json
) from the Cloud Console.
- Ensure you're using Python 2.7.
- Install the required libraries using pip:
pip install --upgrade google-api-python-client oauth2client
-
Place the
credentials.json
file in the same directory as the script. -
Execute the script:
python backup_calendar.py
-
A browser will open for authentication. Log in to your Google account and grant access.
- Backup JSON files will be created in the local directory.
- Files will be uploaded to the
Calendar_Backups
folder on Google Drive.
- credentials.json: Your Google Cloud credentials file.
- token.json: Authentication token automatically generated after the first login.
- backup_calendar.py: The main script file.