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

Skip first line in import statement using gc.open_by_url from gspread (i.e. add header=0)

What is the equivalent of header=0 in pandas, which recognises the first line as a heading in gspread? pandas import statement (correct) import pandas as pd # gcp / google sheets URL df_URL =…
user4933
  • 1,485
  • 3
  • 24
  • 42
5
votes
1 answer

How to format a datetime so Google sheets recognise the value as date time

I'm currently using gspread to retrieve data from a Google sheet into a pandas DataFrame. In order to do that, I simply followed their example at https://gspread.readthedocs.io/en/latest/user-guide.html#using-gspread-with-pandas df =…
E. Jaep
  • 2,095
  • 1
  • 30
  • 56
5
votes
2 answers

Uploading pandas dataframe to google spreadsheet

I followed the steps here and here but couldn't upload a pandas dataframe to google sheets. First I tried the following code: import gspread from google.oauth2.service_account import Credentials scope = ['https://spreadsheets.google.com/feeds', …
realkes
  • 833
  • 1
  • 12
  • 20
5
votes
1 answer

Gspread append_row appending data to different column

see the output here I am using append_row to add data to a google sheet... I don't understand why this is happening #the code def write_to_dangersheet(flow): credentials_file = "file.json" scope =…
kahuria00
  • 317
  • 1
  • 5
  • 14
5
votes
2 answers

gspread - Getting values as string from numeric like column

I am trying to read a google sheet using python using the gspread library. The initial authentication settings is done and I am able to read the respective sheet. However when I do sheet.get_all_records() The column containing numeric like values…
Jithin P James
  • 752
  • 1
  • 7
  • 23
5
votes
2 answers

GSpread Cell Merging

I am trying to merge cells in Gsheets using Gspread for Python, however I can't find any documentation. I have used the gspread_formatting module to format the text and colour of the cell, but I can't find anything to do with merging of the…
Dylan Logan
  • 395
  • 7
  • 18
5
votes
2 answers

'ServiceAccountCredentials.from_json_keyfile_name' equivalent for remote json

I'm setting up a program to help the user with their notes for a research paper, and I'm at the point where i need to separate the client_secret.json from the program files to keep it secure online. How do I get the creds from the json without…
5
votes
4 answers

GSpread pass credentials from Python not JSON

Im using GSpread trying to pass the content on my JSON file (Google API Service Application credentials) as a python Dictionary on my script. Im trying to not to carry a json file wherever I take my script. I get the following error when I tried to…
Alvaro Lamadrid
  • 355
  • 2
  • 13
5
votes
2 answers

Update Googlesheet cell with timestamp from Python

I'm attempting to update a cell in a google sheet with the current date/time of my machine using python 3.6.5. I'm using gspread to connect to the google sheet. If I do the following it will give the date/time that I'm looking to put into google…
C.Felix
  • 53
  • 1
  • 4
5
votes
1 answer

Read cell format from Google sheet using Python (API v4)

I'm looking for a way to read a cell's formatting from a Google sheet in Python, specifically, its background colour. Two popular packages I've found to be able to read a sheet are gspread (fork) and pygsheets. I tried both and they work well in…
Sidewinder
  • 369
  • 3
  • 13
5
votes
0 answers

Sharing google sheet with service account when 'Sharing outside of organization is OFF'

I'm using GSpread to download data from Google sheets and store them in a Postgres DB for different organisations. Unfortunately one organisation has activated G Suite's strict sharing setting which makes it impossible for users to share documents…
5
votes
3 answers

Can Gspread insert new columns at location?

I am trying to use Gspread to insert new columns at a location. I found add_cols methods, but it inserts only in the last column of spreadsheet. There are other methods such as: insert_rows, resize or append_rows but nothing can solve my problem.…
Khanh Le
  • 404
  • 4
  • 18
5
votes
1 answer

creating a worksheet using gspread

I am new to python. I was just trying to create a google worksheet using gspread. I read about using google api's from here. I downloaded credentials from Google Developers Console which is a file in json format. Then I used this code import…
Vivek Puri
  • 161
  • 1
  • 1
  • 13
5
votes
2 answers

'str' does not support the buffer interface Python 3 error for oauth

import json import gspread from oauth2client.client import SignedJwtAssertionCredentials json_key = json.load(open('Crowds-9569176f5988.json')) scope = ['https://spreadsheets.google.com/feeds'] credentials =…
Abhishek Bhatia
  • 9,404
  • 26
  • 87
  • 142
5
votes
2 answers

gspread or such: help me get cell coordinates (not value)

By using GSpread I have a range of cell's returned from a google spreadsheet that has all its elements something like this: I know how to get from here the cell value: cell.value but I would also like to get the address…
Laci
  • 566
  • 2
  • 15
  • 39
1 2
3
63 64