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

worksheet.format("A2:A", { "numberFormat": { "type": "DATE_TIME" }}) doesn't work for text

I'm trying to log temperature and humidity to a google spreadsheet using gspread and python. That works, however when I insert a row using the following code: worksheet.append_row((datetime.datetime.now().strftime("%d-%m-%Y %H:%M:%S"), temp,…
2
votes
1 answer

Function for updating sheet name in gspread is not working

it seems that I can't update the sheet (worksheet) name, what to do? sh = gc.open('My worksheet') worksheet = sh.get_worksheet(0) worksheet.update_title = 'my sheet'
Led
  • 662
  • 1
  • 19
  • 41
2
votes
2 answers

python (gspread) - whole data table placed in one cell of my Google Sheets instead of separate cells

My goal is to update a Google Sheets document by replacing the content of its first sheet by a table of my own data (that is, a table of instances against attributes of a class). I have attempted to use the module gspread to do so but it hasn't been…
arcrub
  • 170
  • 1
  • 11
2
votes
1 answer

Opening a public spreadsheet in a colab notebook with gspread without authenticating

I have a publicly available dataset hosted in a Google Spreadsheet. I can open that from my Colab notebook using gspread as follows: import gspread from oauth2client.client import GoogleCredentials gc =…
Jsevillamol
  • 2,425
  • 2
  • 23
  • 46
2
votes
1 answer

Get all records from 2 columns, starting from specific row

Set-up Via gspread I have access to a Google sheet containing data. Normally, I use df = pd.DataFrame(wsheet.get_all_records()) to dump all data into a pandas dataframe. Issue I only need the data of 5 specific sequential columns, i.e. all columns…
LucSpan
  • 1,831
  • 6
  • 31
  • 66
2
votes
0 answers

How can I authorize gspread when i cannot share my sheet to the service account client_email?

I am trying to use gspread to access some sheets at work. I followed all the steps here -> https://gspread.readthedocs.io/en/latest/oauth2.html However, I am stuck in this step: Go to your spreadsheet and share it with a client_email from the step…
2
votes
1 answer

pull data from multiple sheets in google colab research

I can pull data from google spreadsheet by using from google.colab import auth auth.authenticate_user() import gspread from oauth2client.client import GoogleCredentials gc = gspread.authorize(GoogleCredentials.get_application_default()) …
2
votes
1 answer

How to cache authorization for Google Sheets using gspread?

I am trying to create a simple function that posts some data to a Google Sheets spreadsheet. I am hosting this function in AWS Lambda. Anyway, the code looks kinda like this: import gspread from oauth2client.service_account import…
darkhorse
  • 8,192
  • 21
  • 72
  • 148
2
votes
1 answer

how to reset all rows and column data uisng python gspread sheets

I have the google sheet in which sheet has all data but how to reset the google sheet before adding the data in same google sheets any help would be appreciated Google Sheet Image Link Given Here :https://i.stack.imgur.com/6sbvr.png
user12571160
2
votes
1 answer

Changing column format in google sheets by gspread and google sheets API

I am using gspread and I am looking for a proper way to changing column format by script. I have a column with time durations. I would like to change format of entire column to duration. In Google UI I can mark entire column then click format, then…
strg
  • 116
  • 3
  • 7
2
votes
2 answers

How to clear a range in google sheet via gspread

Hi I would like to clear a range of A3:J10000 in google sheet by using gspread. Doing a loop like this takes too much time: for cell in…
zeppelin11
  • 103
  • 2
  • 3
  • 9
2
votes
1 answer

How do you refresh an authentication token with Authlib and GSpread?

I'm using gspread in a python app to access some backend Google Sheets that act as a database for the application. The user is required to log into the app using an in app browser and an authlib OAuth2 session is created using the token returned in…
fooforever
  • 379
  • 1
  • 3
  • 14
2
votes
1 answer

How do you modify an existing protected range in Google sheets with a python script

I am currently using gspread to access a google sheet and I want to protect a certain range using python but I am not sure how to go about doing it. For example, the protected range is now 'Form Responses 1'!3:500 and I want to update it to 'Form…
ohdanny
  • 33
  • 5
2
votes
1 answer

Is there a way to format multiple worksheets using the googlesheets api and gspread

I'm currently writing a python program which scrapes data from a website and then writes that info into a google spreadsheet. Based on the data contained in each row the data is separated into different worksheets inside of the main spreadsheet.…
2
votes
1 answer

python gspread - How to delete/remove column in google-sheet-API

I'm logging data from a CSV file to google sheet using gspread in python with values_update(). I then use gspread-formatting to create a background color. Since I haven’t found a way to format colors from the CSV, my script reads the data in column…
Iddos
  • 127
  • 3
  • 9