Answer the question
In order to leave comments, you need to log in
Why are empty values not being read when trying to read a GoogleSheets row?
import httplib2
import apiclient.discovery
from oauth2client.service_account import ServiceAccountCredentials
from pprint import pprint
def read_google_sheets(r):
values = service.spreadsheets().values().get(
spreadsheetId=spreadsheet_id,
range=r,
majorDimension='ROWS'
).execute()
return values
CREDENTIALS_FILE = 'Project-99f7721baf37.json'
spreadsheet_id = '1walrfWQ65rxYF7dArX1HNOYYx9ROMo18jnK9NPAAAAA'
credentials = ServiceAccountCredentials.from_json_keyfile_name(
CREDENTIALS_FILE,
['https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.com/auth/drive'])
httpAuth = credentials.authorize(httplib2.Http())
service = apiclient.discovery.build('sheets', 'v4', http = httpAuth)
pprint(read_google_sheets('A1:D1'))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question