This script will create a calendar, and insert all of the events present on the excel/csv formatted file, taking into consideration all possible outcomes from its parameters, such as Subject
, Start Date
, All Day Event
, Location
, Private
, etc.
There is an example of the formatted file just down below. ↓
If you have been using Google Calendar and came across the Import CSV
option, but couldn't automate the insertion of events through a .csv
file using the Google Calendar API, this script might help you!
If you have an excel file that is formatted in the same way, don't worry, the script will work!
In order for the events to be successfully inserted, you'll need to get your client_secret.json
file from the Google Cloud Platform, if you scroll down a little you can find a guide on how to get your secret file ↓↓↓.
On this repository there are two sample files, they contain the same data, but are in two different formats:
This is how the
.csv
formatted file from theImport CSV
Google Calendar option looks like.
Before you run the script, you'll need to get your client_secret.json
file, you can do that by signing into the Google Cloud Platform:
After logging in or signing into your Google account, you'll need to create a project on the platform:
Rename the OAuth authentication file to
client_secret.json
and place it in your current directory.