MCPcopy
hub / github.com/burnash/gspread / update_cell

Method update_cell

gspread/worksheet.py:745–767  ·  view source on GitHub ↗

Updates the value of a cell. :param int row: Row number. :param int col: Column number. :param value: New value. Example:: worksheet.update_cell(1, 1, '42')

(
        self, row: int, col: int, value: Union[int, float, str]
    )

Source from the content-addressed store, hash-verified

743 return self.update_cell(*(a1_to_rowcol(label)), value=value)
744
745 def update_cell(
746 self, row: int, col: int, value: Union[int, float, str]
747 ) -> JSONResponse:
748 """Updates the value of a cell.
749
750 :param int row: Row number.
751 :param int col: Column number.
752 :param value: New value.
753
754 Example::
755
756 worksheet.update_cell(1, 1, '42')
757 """
758 range_name = absolute_range_name(self.title, rowcol_to_a1(row, col))
759
760 data = self.client.values_update(
761 self.spreadsheet_id,
762 range_name,
763 params={"valueInputOption": ValueInputOption.user_entered},
764 body={"values": [[value]]},
765 )
766
767 return data
768
769 def update_cells(
770 self,

Callers 5

update_acellMethod · 0.95
test_update_cellMethod · 0.80
test_findMethod · 0.80

Calls 3

absolute_range_nameFunction · 0.85
rowcol_to_a1Function · 0.85
values_updateMethod · 0.45

Tested by 4

test_update_cellMethod · 0.64
test_findMethod · 0.64