Row

class Row

A list subclass where every item is a Cell.

Obtain a Row from get_row(), values(), or append() (with get_row=True).

Every cell in a row carries its column label ("A", "B", "AA", …), its 1-based row index, and a back-reference to its parent Row.

row = await tab.get_row(1)

print(row[0])             # cell value as a string
print(row[0].label)       # "A"
print(row[0].row_index)   # 1

Methods

async Row.update(values, start='A')

Overwrites the row’s values starting from column start.

Parameters:
  • values (list) – New values to write.

  • start (str) – Column label to start writing from. Defaults to "A".

await row.update(["Alice", "30", "Engineer"])
await row.update(["30"], start="B")   # update column B onward only
async Row.clear()

Clears all values in the row.

await row.clear()
async Row.style(obj)

Applies formatting to every cell in the row.

Parameters:

obj – A Style instance or a raw gspread_formatting.CellFormat.

from betterspread import Style
await row.style(Style(bold=True, bg_color="#ffe599"))
async Row.append_cell(value)

Appends one or more values to the end of the row.

Parameters:

value – A single value or a list of values.

await row.append_cell("new value")
await row.append_cell(["col1", "col2"])
async Row.refetch()

Reloads the row’s values from the remote spreadsheet.

await row.refetch()
async Row.delete()

Deletes the entire row from the sheet.

await row.delete()