Google Spreadsheets Python API v4
76
Create an inventory worksheet that enforces clean data entry and highlights issues with visual cues.
low_stock_threshold are tinted amber and values of zero are tinted red whenever rules are refreshed. @test@generates
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.
"""Google Sheets API client for Python; used for worksheet creation, range validation, checkboxes, and conditional formatting.
Install with Tessl CLI
npx tessl i tessl/pypi-pygsheetsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10