gsheet_feeder.gworksheet#
Module Contents#
- class gsheet_feeder.gworksheet.GWorksheet(worksheet, columns=COLUMN_NAMES, header_row=1)#
This class makes read/write operations to the a worksheet easier. It can read the headers from a custom row number, but the row references should always include the offset of the header. eg: if header=4, row 5 will be the first with data.
- COLUMN_NAMES#
- wks#
- columns#
- values#
- col_exists(col: str)#
- count_rows()#
- get_row(row: int)#
- get_values()#
- get_cell(row, col: str, fresh=False)#
returns the cell value from (row, col), where row can be an index (1-based) OR list of values as received from self.get_row(row) if fresh=True, the sheet is queried again for this cell
- get_cell_or_default(row, col: str, default: str = None, fresh=False, when_empty_use_default=True)#
return self.get_cell or default value on error (eg: column is missing)
- set_cell(row: int, col: str, val)#
- batch_set_cell(cell_updates)#
receives a list of [(row:int, col:str, val)] and batch updates it, the parameters are the same as in the self.set_cell() method
- to_a1(row: int, col: str)#