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
1
vote
1 answer

How do you search a sheet using gspread for an item matching multiple criteria?

I'm trying to develop a Python script to search a sheet for a particular row, matching multiple criteria. I'll start with a sample scenario, a fruits menu in Google Sheets. See screenshot below. Note, this example might or might not reflect actual…
RCube123
  • 213
  • 2
  • 8
1
vote
1 answer

Conditionally format cells in a google sheet using pygsheets

I am trying to learn how to conditionally format cells in a worksheet using pygsheets. The reason for this is to only allow the end user interacting with a google sheet to only be able to input values that are in the correct format. For example, how…
user4933
  • 1,485
  • 3
  • 24
  • 42
1
vote
1 answer

Gspread Exception API Error Code 400 - Invalid Argument

I've created two different variables which contain a list of user input results. I've put those two variables into another variable so I can update a single row on my spreadsheet with this data. However, I'm unable to do this because of this…
cameron.g
  • 13
  • 4
1
vote
1 answer

Appending data to a Google Sheet using Python

I have 3 different tables I'm looking to directly push to 3 separate tabs in a Google Sheet. I set up the GSpread connection and that's working well. I started to adjust my first print statement into what I thought would append the information to…
1
vote
1 answer

Python GSpread - Loop through rows

I am trying to loop through the rows on a Google sheet using python and gspread. Every time I try to get the values, the list is returned as columns and not rows. Is there a way to retrieve the rows and loop through them? Looking here…
1
vote
1 answer

Unable to apply formula in a column of google sheet using python

import pandas as pd import pygsheets import gspread from gspread_dataframe import set_with_dataframe from google.oauth2.service_account import Credentials def csv_to_sheets(): tokenPath ='path for service account file.json' scopes =…
1
vote
1 answer

gspread requires an older google-auth

Today pip -install --user --upgrade told me gspread 5.7.0 requires google-auth==1.12.0, but you have google-auth 2.14.1 which is incompatible. Please note the huge discrepancy in google-auth version numbers: 1.12 vs 2.14. I think I update my…
sds
  • 58,617
  • 29
  • 161
  • 278
1
vote
1 answer

Not able to append values from a dataFrame to a google sheet at specific columns

import pandas as pd import pygsheets import gspread from gspread_dataframe import set_with_dataframe from google.oauth2.service_account import Credentials def csv_to_sheets(): tokenPath ='path for service account file.json' scopes =…
1
vote
1 answer

If duplicate URL entry exists don't append the data (BeautifulSoup to Google Sheets)

I was wondering if you can help. I'm using beautifulsoup to write to Google Sheets. I've created a crawler that runs through a series of URLs, scrapes the content and then updates a Google sheet. What I now want to do is if a duplicate URL exists…
1
vote
0 answers

Google Colaboratory Export data to google sheets

I created the following code in google colab - I don't know how to get the data from the URL response (symbol, bidPrice, askPrice) to the export code to google shets - the export code works for me. I will be very grateful for your answer. import…
elbingerr
  • 19
  • 5
1
vote
1 answer

gspread update worksheet with csv batch

This is the code I have that is using gspread and I am trying to use the update_batch(body) method, but I'm running into some errors I don't understand. The message I'm getting is on the line sh.batch_update(body). The error message is 'invalid…
maggiemay
  • 13
  • 3
1
vote
0 answers

Python gspread You cannot share this item because it has been flagged as inappropriate

Hi I am using gspread with python and I want to share acreate google sheet as you can see below import pandas as pd import gspread from oauth2client.service_account import ServiceAccountCredentials data = { "calories": [420, 380, 390], …
C.D.
  • 19
  • 6
1
vote
3 answers

How to fix timeout while parsing a JSON feed into a Google Sheet?

I'm pretty new to this and it's taken me days to get this far, the script I have now that pushes a JSON feed into a Google Sheet works for my test link, but times out when used with the URL I actually need to pull from. I can confirm the real URL…
Anthony Madle
  • 371
  • 1
  • 10
1
vote
1 answer

HTPP Error 403 while pulling JSON feed when I definitely have access

Confused as to why I'm seeing the 403 Forbidden error when I have access. I tested out the API, I can print to terminal no problem with this script: import requests as rq from bs4 import BeautifulSoup # import urllib3 # import certifi # #…
Anthony Madle
  • 371
  • 1
  • 10
1
vote
1 answer

How to print JSON data to a Google Sheet using GSpread

I have tried every possible fix I can find online, unfortunately, I'm new to this and not sure if I'm getting closer or not. Ultimately, all I am trying to do is print a JSON feed into a Google Sheet. GSpread is working (I've appended just number…
Anthony Madle
  • 371
  • 1
  • 10