Google Spreadsheet API in flask python
slip1244 (257)

How can I import all the necessary packages in? I tried using "import oauth2client" but it shows this error message.

You are viewing a single comment. View All
Answered by timmy_i_chen (1188) [earned 5 cycles]
View Answer
slip1244 (257)


import pygsheets
import pandas as pd

def write(topp1, topp2, topp3):
  name=input("What is the name of the google doc?")
  gc = pygsheets.authorize(service_file='client_secret.json') #YOUR SECRET CODE THING

  # Create empty dataframe
  df = pd.DataFrame()

  # Create a column
  df['stuff'] = ["help", "me"] #stuff is title, help, and me, are the rows below

  #open the google spreadsheet (where 'PY to Gsheet Test' is the name of my sheet)

  #select the first sheet 
  wks = sh[0]

  #update the first sheet with df, starting at cell B2.