Questions tagged [gspread]

gspread is an asynchronous Python library for interacting with Google Spreadsheets.

gspread is a Python library for interacting with Google Spreadsheets.

949 questions
2
votes
1 answer

Add a key/value pair(With caculation) in a list of dictionaries

I used gspread and pandas to convert my google sheet into a list of dictionaries. My google sheet is shown as the following list: (It's a very long list, so I only list a few lines) mysheet=[{'StartDate': '2021-10-02', 'ID': 11773, 'Receiver':…
Mary
  • 231
  • 1
  • 3
  • 12
2
votes
1 answer

GSpread - get also None-values when reading?

i want to read data from google sheets using gspread - but i also want the None values in the nested list - I read the data with the following code and it works fine: FN = "TestSheetGSPREAD" wb1 = gc.open (FN) ws1 = wb1.get_worksheet(0) data =…
Rapid1898
  • 895
  • 1
  • 10
  • 32
2
votes
1 answer

Is it possible to fill down the entire column by Excel formula as in GUI? #gspread

Is it possible in gspread library to fill down the entire column by Excel formula as in GUI, without going through each line? Currently, I'm using the method below: def _update_formula(sheet): for i in range(2, 100): …
2
votes
1 answer

Add data after the last filled line of Google Sheets, with gspread python

I need to add a dataframe's values to the end of the last row of records in my Google spreadsheet, but I can't. Each time I use the code below, it subscribes to the above information. I'm using a gspread library to update the data in the Google…
2
votes
1 answer

Adding a value to a cell breaks conditional formatting in google sheets using gspread

I have a google sheets worksheet which looks like this: col1 col2 col3 col4 ABC 10 ABC 145.1 ABC 15.5 ABC 574.5 ABC 26.7 ABC 45.4 I mark cells red if their…
Jonas Palačionis
  • 4,591
  • 4
  • 22
  • 55
2
votes
1 answer

Django Python With Gspread: 'choices' must be an iterable containing (actual value, human readable name) tuples

I am trying to do something that I have never seen done before with django, I am trying to make a model field(path_choices) that shows all of the unique path_names from my google sheet in a choice box so that the user can select one of them. However…
Reacher42
  • 31
  • 3
2
votes
1 answer

gspread.exceptions.RequestError 404

When read/write from the google sheets, have this error: gspread.exceptions.RequestError: (404, '404: b\' ... Sorry, unable to open the file at present.

Please check the address and try again.

The code has been working for…
0xdev
  • 51
  • 1
  • 3
2
votes
1 answer

Uploading a multiindex dataframe to google sheets using df2gspread

I have a multiindex dataframe that looks like this: df = pd.DataFrame.from_dict({('group', ''): {0: 'A', 1: 'A', 2: 'A', 3: 'A', 4: 'A', 5: 'A', 6: 'A', 7: 'A', 8: 'A', 9: 'B', 10: 'B', 11: 'B', 12: 'B', 13: 'B', 14:…
Jonas Palačionis
  • 4,591
  • 4
  • 22
  • 55
2
votes
1 answer

Fetching Google Sheet data from locally mounted drive via gspread

I am working on a Google Colab notebook that requires the user to mount google drive using the colab.drive python library. They then input relative paths on the local directory tree (/content/drive/... by default on that mount) to files of interest…
2
votes
3 answers

Get list of all google sheets using gspread?

Currently I can connect using gspread and create/share a spreadsheet. I can also read data from said spreadsheet but I have to request it by name. Is there a way to list of all spreadsheets shared with the OAuth account being used. I may not know…
Mike - SMT
  • 14,784
  • 4
  • 35
  • 79
2
votes
0 answers

How to view and edit mounted gdrive files in gspread format without authentication on google colab?

I have mounted the google drive using the in-built function on google colab. According to google, this means that the files should act as if they were accessible and editable from the local directory. However, file = open("file path", "r+") leads to…
2
votes
2 answers

Append a new row to the end of sheets using Gspread

I have this code, I need to append the values to the columns in my google sheet and the values should be added at the end of the sheet in a new row without deleting existing datas all_values = worksheet.get_all_values() row_count =…
CodeRed
  • 81
  • 2
  • 10
2
votes
0 answers

How to connect Google Sheets from Google Cloud Datalab using Python SDK and service account?

I'm trying to fetch data from a shared Google Sheet using Python SDK from Google Cloud Datalab. I did the following: Created a new Notebook on Google Cloud Datalab Obtained a service account which is used by the Notebook, as described on the Key…
2
votes
5 answers

gspread worksheet.update error - Worksheet has no attribute 'update'

I am trying to write a dataframe to an open Google Sheet in Google Colab, but am getting the error: AttributeError: 'Worksheet' object has no attribute 'update' I documented and tested the parts up to the error. # General Imports # Example at…
2
votes
1 answer

Pandas Dataframe - (Column re structure)

I have a dataframe that has n number of columns. These contain letters, the amount of letters a column contains varies and a letter can appear in various amounts of columns. I need the code for a pandas dataframe to convert the sheet to columns…
Dammon
  • 117
  • 1
  • 1
  • 8