Row¶
- class Row¶
A
listsubclass where every item is aCell.Obtain a
Rowfromget_row(),values(), orappend()(withget_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 parentRow.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:
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
Styleinstance or a rawgspread_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()