# Google Sheets Tasks


A collection of tasks for interacting with Google Sheets.

# WriteGsheetRow

class

prefect.tasks.gsheets.gsheets.WriteGsheetRow

(credentials_filename=None, sheet_key=None, worksheet_name=None, **kwargs)[source]

A task for writing a row to a Google Sheet. Note that all initialization settings can be provided / overwritten at runtime.

Args:

  • credentials_filename (Union[str, pathlib.Path]): Location of credentials file
  • sheet_key (str): The key corresponding to the Google Sheet
  • worksheet_name (str): The worksheet to target
  • **kwargs (optional): additional kwargs to pass to the Task constructor

methods:                                                                                                                                                       

prefect.tasks.gsheets.gsheets.WriteGsheetRow.run

(data, credentials_filename=None, sheet_key=None, worksheet_name=None)[source]

Appends a row of data to a Google Sheets worksheet

Args:

  • data (list): the data to insert. This should be formatted as a list
  • credentials_filename (Union[str, pathlib.Path]): Location of credentials file
  • sheet_key (str): The key corresponding to the Google Sheet
  • worksheet_name (str): The worksheet to target
Returns:
  • a dictionary containing information about the successful insert



# ReadGsheetRow

class

prefect.tasks.gsheets.gsheets.ReadGsheetRow

(credentials_filename=None, sheet_key=None, worksheet_name=None, **kwargs)[source]

A task for reading a row from a Google Sheet. Note that all initialization settings can be provided / overwritten at runtime.

Args:

  • credentials_filename (Union[str, pathlib.Path]): Location of credentials file
  • sheet_key (str): The key corresponding to the Google Sheet
  • worksheet_name (str): The worksheet to target
  • **kwargs (optional): additional kwargs to pass to the Task constructor

methods:                                                                                                                                                       

prefect.tasks.gsheets.gsheets.ReadGsheetRow.run

(row, credentials_filename=None, sheet_key=None, worksheet_name=None)[source]

Appends a row of data to a Google Sheets worksheet

Args:

  • row (int): The number of the row to read
  • credentials_filename (Union[str, pathlib.Path]): Location of credentials file
  • sheet_key (str): The key corresponding to the Google Sheet
  • worksheet_name (str): The worksheet to target
Returns:
  • a list of values from the row



This documentation was auto-generated from commit 59ae220
on April 9, 2021 at 15:46 UTC