tessl install tessl/pypi-pygsheets@2.0.0Google Spreadsheets Python API v4
Agent Success
Agent success rate when using this tile
76%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.23x
Baseline
Agent success rate without this tile
62%
Design a utility that keeps a spreadsheet worksheet in sync with incoming time-entry records by reading existing rows, appending new data, and refreshing a summary row. Use the provided sheets client to open the spreadsheet by id and target the worksheet matching the given title; all table data begins at cell A1.
["Employee", "Hours", "Project"] starting at A1:C1 before any data rows are added. @test"TOTAL" in the first column and the numeric sum of the Hours column in the second column, replacing any previous summary row and ignoring header or old summary rows when calculating the total. @testrows_appended and total_hours, where total_hours matches the Hours value written in the summary row. @test@generates
from typing import Any, Dict, List
def sync_timesheet(sheets_client: Any, spreadsheet_id: str, worksheet_title: str, entries: List[Dict[str, Any]]) -> Dict[str, Any]:
"""
entries: list of records with Employee (str), Hours (number), and Project (str)
returns: {"rows_appended": int, "total_hours": float}
"""Provides spreadsheet access for reading and writing values.