简体   繁体   中英

How to read data from google sheet through google app engine?

I have a local flask app that is reading data from a csv file. Using the below code, I am able to successfully read in the data from columns one and two of a spreadsheet called "Vocab". the "service_account.json" is currently saved in my local working directory with my other application files.

    gc = gspread.service_account(filename='service_account.json')
    sh = gc.open("Vocab")
    worksheetOne = sh.sheet1
    self.columnOne = [str(i) for i in worksheetOne.col_values(1)]
    self.columnTwo = [str(i) for i in worksheetOne.col_values(2)]

I am now trying to deploy this flask app to google app engine, but I am not sure on how to replace the local "service_account.json" file that I am using for credentials so that I am able to access my google sheet info. What would be the best way to access my google sheet info from my google app?

Why do you need to replace it? You can include it in the deploy so it is read the same way

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM