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
0
votes
1 answer

How can I update a cell based on a value pygsheets?

Hi I am trying to update a cell e.g. B4 given that the cell e.g. A4 corresponds to my query. I am using pygsheets library. What I have done thus far was to use cell_list = wks.find("wednesday")to determine which cell object is it in, afterwards, I…
0
votes
1 answer

I want to add data below the last value of row a. (pygsheet)

sh[9].append(values=[claststr], start='a8') This code adds a column. I want to add a value to the next column with the last value of row 'a' or 'b'.
0
votes
2 answers

How to delete cells from a GSheet programatically?

I have a GSheet that I am using in my Flutter app to record a timestamp of when a user clicks on a button. The timestamp gets stored in column B. Is there a way (I've heard of AppScript but unsure) that I can check my entire google sheet in a single…
Arnav
  • 1,404
  • 2
  • 19
  • 38
0
votes
1 answer

set_data_validation with pygsheets | Python<>Google Drive

I struggle with setting the data validation in my Google spreadsheet document using pygsheets. I found this function: wks.set_data_validation((startIndex, wks.get_named_ranges("stdArbeitsauftrag").start_addr[1]), condition_type='ONE_OF_RANGE',…
0
votes
2 answers

Issues / question with batch update with pygsheets / google sheets

Ok I'm new to python but...I really like it. I have been trying to figure this out for awhile and thought someone could help that knows a lot more than I. So what I would like to do is use pygsheets and combine batch the updates with one api call…
E_L
  • 3
  • 2
0
votes
1 answer

Library errors when running python script on Amazon Linux instance

I am trying to get a script up and running on AWS Lambda and I have had some issues running the script. To go through each of my problems. I first prepared the script using virtualenv and uploaded it. When I tried to invoke the script, I received…
cpuser
  • 37
  • 7
0
votes
0 answers

How can i solve an authorization error for pygsheets?

i have spent the las few days trying to run this code: import googlemaps import pygsheets API_key = 'XXX'#enter Google Maps API key gc = pygsheets.authorize(service_file="/Users/Eliana/Desktop/Cash Flow dCaC-454d56c8c130[41].json") sh =…
0
votes
2 answers

How to insert Dataframe into Google Sheet dynamically using pygsheet

I am trying to insert a number of Dataframes into google spreadsheet. I am using the pygsheets module. I have a variable that the stores the row number in a loop. I am trying to have the Dataframe inserted in the corresponding cell reference. I am…
Kevin Nash
  • 1,511
  • 3
  • 18
  • 37
0
votes
1 answer

Mentioning cell where Pandas Dataframe gets inserted in Google Sheet

I have a data frame of 100 rows that I am trying to split into multiple Dataframes as per the below code: for m in df['month'].unique(): temp = 'df_{}'.format(m) vars()[temp] = finance_metrics[df['month']==m] This gives me 5 new Dataframes…
Kevin Nash
  • 1,511
  • 3
  • 18
  • 37
0
votes
1 answer

Python - Conditional Formatting Google Sheets - 'Spreadsheet' object has no attribute 'add_format'

I'm trying to upload my code that applies conditional formatting to an Excel file using pandas dataframe values on a google sheets file. For that I have the following code: import pygsheets import pandas as pd gc =…
Pedro Alves
  • 1,004
  • 1
  • 21
  • 47
0
votes
1 answer

is there a way to add only latest values?

I am importing data from excel to google sheets using python code. Everytime I run the script previously updated records getting over write. Please help me with how can I retain previously added values and added only new values.
0
votes
1 answer

Pygsheets: How to highlight cells in a specific column based on a condition

I have a pandas data frame with three columns, and I want to highlight the cells in a specific column that meet a certain condition using pygsheets. How can I do that? A B C some_text 65 some_text def…
0
votes
2 answers

Python: Exporting Output to Google Sheets

I wrote this web scraping program that extracts retail trading sentiment data for 26 forex pairs from IG markets. The output in the console looks like: AUD-CAD: 64% of client accounts are short. AUD-CHF: 54% of client accounts are long. AUD-JPY: 60%…
0
votes
1 answer

How to create pivot table based on data in a spreadsheet?

Lets say I have data in Google Sheets as below: A B C 0 a 33 13 1 b 44 14 2 a 55 15 3 a 66 16 4 b 77 17 5 c 88 18 As stated in the title, is there any way to create a pivot table with pygsheets?
Jeff
  • 127
  • 5
0
votes
1 answer

How to make Tkinter run a command using a button and label out my output in Terminal

So I am making a project that outputs responses from Google Sheets that asks me and gives me video ideas. I just need help figuring out how to make Tkinter output the whole response into a window. Here is the main code for the project I am working…