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

Method _auto_resize

gspread/worksheet.py:1700–1730  ·  view source on GitHub ↗

Updates the size of rows or columns in the worksheet. Index start from 0 :param start_index: The index (inclusive) to begin resizing :param end_index: The index (exclusive) to finish resizing :param dimension: Specifies whether to resize the row or column :

(
        self, start_index: int, end_index: int, dimension: Dimension
    )

Source from the content-addressed store, hash-verified

1698 return res
1699
1700 def _auto_resize(
1701 self, start_index: int, end_index: int, dimension: Dimension
1702 ) -> JSONResponse:
1703 """Updates the size of rows or columns in the worksheet.
1704
1705 Index start from 0
1706
1707 :param start_index: The index (inclusive) to begin resizing
1708 :param end_index: The index (exclusive) to finish resizing
1709 :param dimension: Specifies whether to resize the row or column
1710 :type major_dimension: :class:`~gspread.utils.Dimension`
1711
1712
1713 .. versionadded:: 5.3.3
1714 """
1715 body = {
1716 "requests": [
1717 {
1718 "autoResizeDimensions": {
1719 "dimensions": {
1720 "sheetId": self.id,
1721 "dimension": dimension,
1722 "startIndex": start_index,
1723 "endIndex": end_index,
1724 }
1725 }
1726 }
1727 ]
1728 }
1729
1730 return self.client.batch_update(self.spreadsheet_id, body)
1731
1732 def columns_auto_resize(
1733 self, start_column_index: int, end_column_index: int

Callers 2

columns_auto_resizeMethod · 0.95
rows_auto_resizeMethod · 0.95

Calls 1

batch_updateMethod · 0.45

Tested by

no test coverage detected