Language: Python
I'm trying to go through each "sub-sheet" - or Sheet - in a Google Spreadsheet, and parse it's data. This will ultimately be used to create a local .csv
file.
I've tried using both gspread and gsheets to solve this issue, but both had authentication errors, so I had to use the API directly.
All examples on the Google Spreadsheets API get all the values from a specific range, as in "get everything from row A1:A4 in sheet Sheet1". This isn't beneficial for me, as my script needs to go through however many sheets that are in the spreadsheet, I'm parsing all the data and I don't know the Sheet name beforehand.
According to the docs, a Sheet object should have a 'data' field, but all of my curr_sheet.get('data')
parses return None:
https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/sheets#Sheet
The Excel sheet I'm trying to parse looks like this: https://i.gyazo.com/62606b2434435d34dd3ba9fbd9825a52.png
sheet = service.spreadsheets()
result=sheet.get(spreadsheetId=SPREADSHEET_ID).execute()
print(result2)
all_sheets = result.get('sheets')
for curr_sheet in all_sheets:
print(curr_sheet)
I need to parse a single value from a specific row, and then save the file as a .csv
locally. I've narrowed the problem down to iterating through the specific sheets, so any help would be greatly appreciated!