neuralib.tools.gspread.upload_dataframe_to_spreadsheet

neuralib.tools.gspread.upload_dataframe_to_spreadsheet(df, gspread_name, worksheet_name, service_account_path, primary_key='Data')[source]

Upload a dataframe to a gspread worksheet

Parameters:
  • df (DataFrame | DataFrame) – polars or pandas DataFrame

  • gspread_name (str) – spreadsheet name

  • worksheet_name (str) – worksheet name under the spreadsheet

  • service_account_path (Path | None) – The path to the service account json file.

  • primary_key (str | tuple[str, ...]) – Primary key of the worksheet. If str type, it must be one of the column name. If tuple str type, the primary key is join using “_” per row

Return type:

None