#header_names = list of header names
spreadclient = gdata.spreadsheets.client.SpreadsheetsClient(source='Your App Name')
#Add a line to authenticate the spreadsheet client
spreadsheet_key = spreadsheet.GetId().split("%3A")[1]
worksheets = spreadclient.GetWorksheets(spreadsheet_key)
#get worksheet id
wsid = worksheets.entry[0].GetWorksheetId()
#header row can only be accessed via cellfeed
for i,name in enumerate(header_names):
cellentry= spreadclient.GetCell(spreadsheet_key, worksheet_id=wsid, row_num=1, col_num=1+i)
#update value
cellentry.cell.input_value = name #TODO: do batch update instead
spreadclient.update(cellentry)