I am able to get the feed from the spreadsheet and worksheet ID. I want to capture the data from each cell.
i.e, I am able to get the feed from the worksheet. Now I need to get data(string type?) from each of the cells to make a comparison and for input.
How exactly can I do that?
The motivation for using Python to write to Google Sheets If you use Python with Google Sheets, it is easy to integrate your data with data analysis libraries, such as NumPy or Pandas, or with data visualization libraries, such as Matplotlib or Seaborn.
There's another spreadsheet library worth to look at: gspread. I've used Google's data libary mentioned above and to me the provided api is weird. You need to extract spreadsheet's key to start working with this spreadsheet.
Here it's a way simpler. If you need to fetch the data from a cell you can just open a worksheet and get the value:
g = gspread.login('[email protected]', 'password')
worksheet = g.open('name_of_the_spreadsheet').get_worksheet(0)
# Say, you need A2
val = worksheet.cell(2, 1).value
# And then update
worksheet.update_cell(2, 1, '42')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With