From the course: Advanced Scripting for Testers: Local Data, Spreadsheets, and Reporting
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Interacting with Google Sheets
From the course: Advanced Scripting for Testers: Local Data, Spreadsheets, and Reporting
Interacting with Google Sheets
- [Instructor] Now that we've set up a Google service account, let's look at how to use that account to access a Google Sheet. So first of all, we're going to need to install a few libraries. So I will use pip install, and we're going to install gspread and google-auth. So, with those installed, we can start making a script to interact with this. So first of all, we'll import the credentials class. So we'll use our google.oauth2.service_account and we'll import credentials from there. And then we're going to make a variable for our SERVICE_ACCOUNT_FILE. And in this case, we will get the file from up one folder because we're in 02_07 here. And then I'll just grab the file name and we'll put it here. So that variable should hold the service's account file. And then we also need to define some scopes. So I'm going to use the google.auth for drive. And then I am also going to add here https://. We want to do the googleapis.com for our spreadsheets as well. So we also want to auth the…
Contents
-
-
-
-
(Locked)
Scripting Excel2m 48s
-
(Locked)
Reading data from Excel7m 5s
-
(Locked)
Writing data to Excel7m 14s
-
(Locked)
Challenge: Create a test report in Excel1m 6s
-
(Locked)
Solution: Create a test report in Excel11m 56s
-
(Locked)
Setting up a Google service account3m 12s
-
(Locked)
Interacting with Google Sheets4m 12s
-
Reading data from Google Sheets3m 57s
-
(Locked)
Writing data to Google Sheets3m 52s
-
(Locked)
Challenge: Consolidate multiple data sources1m 24s
-
(Locked)
Solution: Consolidate multiple data sources5m 47s
-
(Locked)
-
-
-