CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-pygsheets

tessl install tessl/pypi-pygsheets@2.0.0

Google 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%

task.mdevals/scenario-6/

Inventory Validation Sheet

Create an inventory worksheet that enforces clean data entry and highlights issues with visual cues.

Capabilities

Structured validations

  • Builds or clears an "Inventory" worksheet, writes provided header and rows, restricts the Category column to supplied options, requires non-negative integers in Quantity, and sets Restock Needed cells as unchecked checkboxes by default. @test

Low-stock formatting

  • Applies conditional formatting so Quantity values below low_stock_threshold are tinted amber and values of zero are tinted red whenever rules are refreshed. @test

Overdue restock cue

  • Formats Restock By dates earlier than the current day with bold red text, leaving future and empty cells unstyled. @test

Rule refresh

  • Reapplies validations and formatting with new category options and thresholds without altering existing cell values. @test

Implementation

@generates

API

from typing import Iterable, Mapping

def build_inventory_sheet(creds_path: str, spreadsheet_title: str, categories: list[str], rows: Iterable[Mapping[str, object]], low_stock_threshold: int) -> str:
    """
    Creates or resets an Inventory worksheet, writes header + rows, applies data validations and conditional formatting, and returns the spreadsheet URL or key.
    """

def refresh_inventory_rules(creds_path: str, spreadsheet_key: str, categories: list[str], low_stock_threshold: int) -> None:
    """
    Reapplies validations and formatting in-place on an existing Inventory worksheet without removing user data.
    """

Dependencies { .dependencies }

pygsheets { .dependency }

Google Sheets API client for Python; used for worksheet creation, range validation, checkboxes, and conditional formatting.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pygsheets@2.0.x
tile.json