Skip to content

Googlesheet

flowtask.interfaces.GoogleSheet

GoogleSheetsClient

GoogleSheetsClient(*args, credentials=None, **kwargs)

Bases: GoogleClient, ABC

Google Sheets Client for downloading and interacting with Google Sheets.

download_file async

download_file(sheet_id, worksheet_name=None, file_type='dataframe')

Download the content of a Google Sheet in various formats.

Parameters:

Name Type Description Default
sheet_id str

The ID of the Google Sheet.

required
worksheet_name str

The name of the worksheet (optional, defaults to the first sheet).

None
file_type str

Desired format - 'dataframe', 'json', 'excel', or 'csv'.

'dataframe'

Returns:

Type Description
Union[DataFrame, str]

pd.DataFrame or str: DataFrame if requested, or the file path for other formats.