autodrive.range

Module Contents

Classes

Range

Provides a connection to the data in a specific range in a Google Sheet Tab.

class autodrive.range.Range(gsheet_range, gsheet_id, tab_title, tab_id, *, auth_config=None, sheets_conn=None, autoconnect=True)

Provides a connection to the data in a specific range in a Google Sheet Tab.

Parameters
  • gsheet_range (FullRange) – The range (i.e. A5:C10) to associate with this Range.

  • gsheet_id (str) – The id string of the target Google Sheet that the Range resides in; can be found in the Google Sheet url.

  • tab_title (str) – The name of the Tab this Range is within.

  • auth_config (AuthConfig, optional) – Optional custom AuthConfig, defaults to None.

  • sheets_conn (SheetsConnection, optional) – Optional manually created SheetsConnection, defaults to None.

  • autoconnect (bool, optional) – If you want to instantiate a Range without immediately checking your authentication credentials and connection to the Google Sheets api, set this to False, defaults to True.

property format_grid(self)
Returns

An object with grid formatting methods.

Return type

RangeGridFormatting

property format_text(self)
Returns

An object with text formatting methods.

Return type

RangeTextFormatting

property format_cell(self)
Returns

An object with cell formatting methods.

Return type

RangeCellFormatting

get_data(self, value_type=EffectiveVal)

Gets the data from the cells of this Range.

Note

This method will cause a request to be posted to the relevant Google API immediately.

Parameters

value_type (GoogleValueType, optional) – Allows you to toggle the type of the values returned by the Google Sheets API. See the dtypes documentation for more info on the different GoogleValueTypes.

Returns

This Range.

Return type

Range

write_values(self, data)

Adds a request to write data. Range.commit () to commit the requests.

Parameters

data (List[List[Any]]) – The data to write. Each list in the passed data list is a row, with each value in that sublist being a column.

Returns

This Tab.

Return type

Range