You can create a dataset using the data stored in your Google Spreadsheet. This feature is especially useful when you have huge volumes of data online. With this feature, you are not required to download the data. Rubiscape can directly connect to the Spreadsheet on your drive and create a dataset using the data in it.
Before you can use Google spreadsheet to create your dataset in Rubiscape, you need to create Google Service Account and give the access to your spreadsheet (share your spreadsheet) with this Service Account.
The prerequisites to create Google Spreadsheet are:
- Creating a project
- Enabling access to Google sheets and Google Drive to the newly created project.
- Creating your service account
- Creating a private key for your service account
- Giving access to the Google Spreadsheet to your Service account
Completing the prerequisites for Google Spreadsheet
Follow the steps given below to give access to your Google Service Account.
- Create a Project. Refer to Creating a Project.
- Enable access to Google Sheets and Google Drive to the newly created project. Refer to Enabling Access to Google Sheets and Google Drive.
- Create Service Account. Refer to Adding Credentials to Service Account.
- Create a Private Key for your service account which can be used to give access. Creating Private Key for Service Account.
- Give access to the Google Spreadsheet to your Service account. Refer to Giving Access to the Service Account.
After completing these steps, your Google Spreadsheet can be accessed through Rubiscape to create dataset.
The further sections explain the steps for each of these prerequisites.
Creating a Project
- To create a project, visit Developer's console
https://console.developers.google.com/.
A list of available projects is displayed. You can select from the list or create a new project. In this case we are creating a new project. If want to use an existing project, skip the further steps and go to Enabling Access to Google Sheets and Google Drive.
In this example, we are creating a new project. - Click CREATE PROJECT.
- New Project page is displayed.
- A default Project name is displayed. It is a unique identifier and recommended not to be changed.
- From the drop-down, select the Organisation.
- Add Location.
- Click CREATE.
The project is created and you are redirected to the Dashboard page.
Enabling Access to Google Sheets and Google Drive
To enable a project's access to Google Sheets and Google Drive, follow the steps given below.
- From the list of projects, locate your project and click SELECT PROJECT.
The Dashboard with Project info is displayed. - Click Go to APIs overview.
The APIs & Services page is displayed. - Click ENABLE APIS & SERVICES.
The API Library page is displayed. - Click Google Sheets API and Google Drive API. You can use the search box to locate APIs.
- Navigate back to the dashboard page and verify that the APIs are added.
Adding Credentials to Service Account
- To add credentials, click Credentials from the left menu.
Credentials page is displayed. - Click CREATE CREDENTIALS.
- Out of the options displayed, select Service account.
- Create Service Account page is displayed.
- Enter Service account name.
- Enter Service account ID.
- Enter Service account description.
- Click CREATE.
- Next, Grant this service account access to the project. Click Role and select the desired role and click Continue. This step is optional.
- Next, Grant users access to this service account. This step is optional.
- After everything is done, click DONE.
The Service Account is created and is added to the Service Accounts list.
Creating Private Key for Service Account
- On the Credentials page, click Manage service accounts.
Service accounts page is displayed. - Locate the newly created service account, click ellipsis corresponding to it, and click Create key.
The Create private key dialog box is displayed. - Select the Key type as JSON.
- Click CREATE.
The Json file containing the key is downloaded to the default download location of your computer.
This file contains the keys that are required to use the Google sheets by other applications (in this case Rubiscape).
Giving Access to the Service Account
After creating Service account and creating a private key, the next step is to give the access to your Google spreadsheet to the created service account.
To give access to your spreadsheet to the service account, follow the steps given below.
- Visit your Google Drive.
- Locate the Spreadsheet whose access you want to give to your service account.
- Click Share.
- Open the Json file downloaded during Creating Private Key for Service Account in a text editor.
- Copy the client_email.
- Paste this client_email in the share field. You can optionally add a notification message.
- Click Done.
A message to confirm the action is displayed. - Click Share Anyway.
The Spreadsheet is shared with the service account. To confirm that, again click the Share. The Share page contains name of the service account as shown below.
The spreadsheet can now be accessed from the Rubiscape application.
Next step is to create dataset using this Google Sheet. Refer to Creating Dataset using Google Sheet.
Creating Dataset using Google Sheet
To create a Google Spreadsheet dataset, make sure you have completed the prerequisites for Google Spreadsheet.
After that, follow the steps given below.
- On the home page, click Create icon ().
Product Selection page is displayed. - Hover over the dataset tile, and click Create Dataset.
Dataset Selection page is displayed. - From the API option, select Google Spreadsheet.
Create Google Spreadsheet Dataset page is displayed. - Enter Name for the dataset.
- Enter Description for the dataset.
- Enter Google spreadsheet file name. This is the same spreadsheet to which access was given to the service account. Refer to Giving Access to the Service Account.
- To upload the JSON file containing the private key, click Browse. This is the same JSON that was downloaded while Creating Private Key for Service Account. Select the JSON file and click ok.
- To fetch the results, Click Fetch.
The Features list is populated. Configure the features as required. Refer to Configuring Feature Type. - Click Create.
The Google Spreadsheet dataset is created in your workspace and is available for use.
Table of Contents