Questions tagged [pygsheets]

A python library to access Google Spreadsheets through the Google Sheets API. Use this tag to ask questions about pygsheets usage and errors

pygsheets is a python library to access Google Spreadsheets through the Google Sheets API (currently API v4). Use this tag to ask questions about pygsheets usage and errors.

Github for the package: https://github.com/nithinmurali/pygsheets

Full package documentation: https://pygsheets.readthedocs.io/en/stable/

167 questions
1
vote
1 answer

Appending Dataframe into google sheet by python

I want to append the data frame of every month data into google sheet by python. I have tried lots of code but it's not working. Is there any way I can append data of every month to google sheet by python? please share the full python code to append…
1
vote
2 answers

Reset the background color of a Cell in pysheet

Trying to reset the color of a linked cell. Looking at a cell without color, the color attribute is (None, None, None, None) So I tried: cell.color = (None, None, None, None) and cell.color = None Both raise TypeError: '<' not supported between…
Jon
  • 13
  • 2
1
vote
0 answers

High Volume of Requests from Lambda (Python Script + Pygsheets) to Google Sheets API

I have created a script on Lambda in Python, primarily using the library pygsheets, that manipulates Google Sheets when invoked. Project is up and working but an odd occurance has been noted. Locally, my project runs quickly (~15 sec) where as on…
1
vote
0 answers

Pygsheets.authorize generating tmp files every time it runs

I am trying to run a simple code using pygsheets. This code has already been tested in other computers, so it is probably some configuration in my machine or OS. In the two lines: creds_file = _google_creds_as_file() gc =…
donut
  • 628
  • 2
  • 9
  • 23
1
vote
1 answer

How to update the bottom row(first empty row) of sheet with data using pygsheets?

I have a spreadsheet linked with the python module with 3 columns. I have tried to insert the new row of data using insert_rows function but it does not do anything and also does not throw any error, making it harder for me to narrow down the…
Ravish Jha
  • 481
  • 3
  • 25
1
vote
1 answer

How to set the (horizontal, vertical) alignment with pygsheets

Can anyone advise me on how to set the horizontal alignment of a cell with pygsheets. I have been attempted to do so via the model_cell approach. One such attempt being the following: model_cell =…
David Kane
  • 135
  • 8
1
vote
1 answer

How to get filtered sheet cells values with pyghseets

How can I get only filtered values from spreadsheet? If user have filtered some values, I don't need them.
Davis Merrit
  • 123
  • 1
  • 1
  • 10
1
vote
1 answer

Pandas read google sheet data types wrong

I read some Google Sheet data through GSpread and Pandas; however, Pandas gives my dtype as object and I cannot change it. I'm sure that my Google Sheet values are numbers, apart from the headers, which are strings. Matplotlib will not allow me to…
zeppelin11
  • 103
  • 2
  • 3
  • 9
1
vote
0 answers

oauth2 authentication failing when called from google cloud function

I am trying to create a google cloud function that is called when a user clicks a button in google sheets. This function goes through the data and updates another sheet. I have been using pygsheets to do this but I would like to use google cloud…
Travis N. Miller
  • 135
  • 1
  • 10
1
vote
1 answer

With pygsheets how to detect if a spreadsheet already exists?

Using pygsheets, I was looking around for a good way to open a Google sheet (by title) if it already exists, otherwise create it. At the same time, I also wanted to make it r/w to myself and r/o to the rest of the world upon creating it.
Jerome Provensal
  • 931
  • 11
  • 22
1
vote
1 answer

Use pygsheets to create a brand-new sheet using the service_file authorization method

I can already edit an existing sheet by using the open_by_key() function but I would like to be able to create a brand-new sheet. When I try the following code: import pygsheets creds_file = "/Users/jerome/audible2googlesheet.json" gc =…
Jerome Provensal
  • 931
  • 11
  • 22
1
vote
1 answer

pygsheets - Using dotenv instead of json file

Connecting to gsheets: the usual way would be to run gc = pygsheets.authorize() with the creds.json file in the same root folder as the script gsheets.py (folder structure below) ├── creds.json ├── gsheets.py Would like to use…
yongsheng
  • 376
  • 3
  • 19
1
vote
1 answer

Setting date format in gsheet through python api using sheet.insert_row()

I have a list of data let say record = ['Tuesday','2018-08-29'] and I try to send it to google sheet through sheet.insert_row(record,index) and I am successfully receiving it on my gsheet but the issue is, that on the gsheet I am getting a date…
1
vote
0 answers

Transfer data from Pandas Dataframe to Google sheets using Pygsheets

The objective of project is to automate some data fetching process. My data consists of 4 different google sheets coming from different resources which after join build prefinal file and this prefinal file use in calculating business numbers. I have…
ritz
  • 39
  • 4
1
vote
1 answer

How can I set domainUsersCanEdit to False in a protected range?

I can edit the list of editors of a protected range just fine. When I create a new protected range, however, it has by default domainUsersCanEdit property set to True. How can I set it to false? Also, related question: using Google UI you can…
1 2
3
11 12