Prerequisites
Before proceeding, ensure the following prerequisites are met:- Install MindsDB locally via Docker or use MindsDB Cloud.
- To connect Google Calendar to MindsDB, install the required dependencies following this instruction.
- Install or ensure access to Google Calendar.
Connection
The required arguments to establish a connection are as follows:credentials_file
is a path to the JSON file that stores credentials to the Google account.
Please note that a Google account with enabled Google Calendar is required. You can find more information here.
You need a Google account in order to use this integration. Here is how to get the credentials file:
-
Create a Google Cloud Platform (GCP) Project:
1.1 Go to the GCP Console (https://console.cloud.google.com/).
1.2 If you haven’t created a project before, you’ll be prompted to do so now.
1.3 Give your new project a name.
1.4 Click
Create
to create the new project. -
Enable the Google Calendar API:
2.1 In the GCP Console, select your project.
2.2 Navigate to
APIs & Services
>Library
. 2.3 In the search bar, search forGoogle Calendar API
. 2.4 Click onGoogle Calendar API
, then clickEnable
. -
Create credentials for the Google Calendar API :
3.1 Navigate to
APIs & Services
>Credentials
. 3.2 Click on theCreate Credentials
button and chooseOAuth client ID
. 3.3 If you haven’t configured the OAuth consent screen before, you’ll be prompted to do so now. Make sure to chooseExternal
for User Type, and add all the necessary scopes. Make sure to save the changes. Now, create the OAuth client ID. ChooseDesktop app
for the Application Type and give it a name. 3.4 ClickCreate
. -
Download the JSON file:
4.1 After creating your credentials, click the download button (an icon of an arrow pointing down) on the right side of your client ID. This will download a JSON file, so you will use the location to it in the
credentials_file
param.
Usage
This creates a database that comes with thecalendar
table.
Now you can use your Google Calendar data, like this:
-
searching for events:
-
creating events:
-
updating one or more events:
-
deleting one or more events:
For more information about available actions and development plans, visit this page.