Posts: 128
Joined: Sun Dec 23, 2012 9:44 pm

Data insertion point using GSpread

Sun Jun 08, 2014 9:38 am

Hi Folks

I have been using the excellent GSpread for some time now to append data to a Google Sheet. However, now that a large amount of data has been collected it has become unwieldy to use from within Google apps; to access the last data that is appended can sometimes take minutes as the app loads the entire data set.

What I would like to do is insert the data into the beginning of the sheet, i.e. so that the most recent data is presented first rather than last. Although there is an "insert row" function in GSpread, I am unsure how to then use this to input multiple items of columnar data.

The relevant portion of my Python script is as follows:

Code: Select all

import gspread
worksheet =
 # Append the data in the spreadsheet, including a timestamp
    values = [, tempa, humiditya, rasp[5:9], sig, uptiming, loading]
    valtim ="%H-%M")
    disptime = []
    print "Unable to append data.  Check your connection?"
I've only pasted the relevant portions of the code above, it should be seen that I'm using the "worksheet.append" function.

Can anyone offer advice?

Thank you

Return to “Python”