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

Proper usage of list_ssheets() with a parent_id in pygsheets

I've been trying to get a handle on how to use list_ssheets() with a parent_id filter. The following works well, and returns a list of all the sheets (including the ones I'm trying to isolate from a folder): the_list_of_sheets =…
Steven Brown
  • 31
  • 1
  • 4
1
vote
0 answers

Pygsheets .updated returns "File not found"

I am trying to check the date of the latest modification to a google sheet using pygsheets 1.1.4, google-api-python-client 1.6.7, and Python 3.6.3 on Windows 10. I can authenticate, view, and edit spreadsheet contents, but when I try to get the…
Crowhill
  • 11
  • 3
1
vote
0 answers

Gets google doc worksheet without hidden rows

I am actually working on a python code where i want to get as a panda dataframe a google doc worksheet with the "pygsheets" library. I am just currently doing this: gc = pygsheets.authorize(credentials=credentials) sh = gc.open_by_key('KEY') wks =…
1
vote
1 answer

Batch cells update with pygsheets

How can I update spreadsheet range with a list of values? For example if I have range A1:C7 and I want 1, 2, 3, 4, ... 21 values in cells. I can't even get a cell list with sheet.range function. cell_list = sh.range('A1:C7', returnas='cells') cause…
Davis Merrit
  • 123
  • 1
  • 1
  • 10
1
vote
2 answers

ImportError: No module named 'pygsheets'

I installed pygsheets module with this command: pip install https://github.com/nithinmurali/pygsheets/archive/master.zip When I tried to execute script, I got following error: Traceback (most recent call last): File …
plaidshirt
  • 5,189
  • 19
  • 91
  • 181
0
votes
0 answers

Returning a random value from some column from Google Sheets only returns the first character

def search_promo_name2( self, data: List[List[Union[str, bool]]], search_col: int = 1, promo_col: int = 2 ) -> int: googlesheet_client: pygsheets.client.Client = self._get_googlesheet_client() wks: pygsheets.Spreadsheet =…
0
votes
0 answers

The same google service account is getting different access to google sheets files depending on computer?

I have a google service account set up so I can run python scripts that access google sheets. I have my work laptop and the office computer set up to run the same script. Office got a new computer and when I set up the script again it lost access to…
George
  • 1
0
votes
1 answer

I can't install pygsheets

When I tried to execute script, I got following error: Could not find a version that satisfies the requirement google-api-python-client>=2.50.0 (from pygsheets==2.0.6) (from versions: 1.0beta5prerelease, 1.0beta5prerelease2, 1.0a1, 1.0a2, 1.0a3,…
0
votes
1 answer

How to speed up updating cell colors with pygsheets?

I'm using this code to update the background color of a range of cells in a google sheet: from pygsheets import Workbook, Color gc = pygsheets.authorize(service_file='path/to/credentials.json') workbook = gc.open('spreadsheet_name') worksheet =…
Jacob H
  • 345
  • 1
  • 11
0
votes
1 answer

Export data to gsheet workbooks / worksheets after looping through a script 10 times

I have the following script I'm running to get data from Google's pagespeed insights tool via API: from datetime import datetime from urllib import request import requests import pandas as pd import numpy as np import re from os import…
0
votes
0 answers

Using pygsheets how do I multiply one cell by the cell in the previous column but same row in a loop?

I am trying to loop over a column in the spread sheet. For each cell in the column I am looping over, I want to multiply the value of the cell by the value in the cell previous in its row (the cell would be the previous cell in the row, i.e I would…
Neslinx
  • 1
  • 2
0
votes
2 answers

Using python to connect or write a google apps script to a google sheet

Is it true that it is not possible to directly connect a Google Apps Script (which uses JavaScript) to a Google Sheets spreadsheet using Python? I am asking this more as a design question: would it not be possible to keep a Google Apps Script in a…
user4933
  • 1,485
  • 3
  • 24
  • 42
0
votes
1 answer

How do I append data in google sheet using python?

I am trying to download the data from IB api and upload it onto a google sheet. If the data already exists in the sheet, then I want the new data to be added into the sheet without overwriting the previous data. This is what I have done so far: from…
0
votes
0 answers

Get google sheet authentication by Replit env variables: key error

I am try to get google sheet api authentication using pygsheets in the Replit. I saved the credentials json content into the "Secrets" function of Replit, the code is as below: import pygsheets import os import json creds =…
beaconho
  • 17
  • 5
0
votes
1 answer

Conditionally format cell to end with one of 2 strings using pygsheets

I am using pygsheets and have a column that I'd like to conditionally format so that its either a string ending in "@gmail.com" or a string ending in "@yahoo.com". It seems to work for one but I am not sure how to extend this to 2 conditions. I went…