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-3/

Developer Metadata Tagger

Utility for orchestrating spreadsheet- and sheet-level developer metadata to track ownership, status, and categorization across a Google Sheets document.

Capabilities

Register metadata entries

  • Creating entries for spreadsheet-level and sheet-level locations stores key/value pairs and replaces any prior entry with the same key at that location, returning records with metadata IDs. @test

Filter metadata

  • Listing metadata with a key prefix and sheet title returns only entries whose keys share the prefix and are attached to that sheet; spreadsheet-level records are included only when no sheet filter is provided. @test

Update values

  • Updating all entries for a given key and location changes their stored values while leaving other keys or locations untouched, and returns updated records. @test

Scoped removal

  • Removing entries by key with a sheet filter deletes only the targeted sheet-level metadata and reports the removal count, leaving the same key on other sheets or the spreadsheet-level intact. @test

Implementation

@generates

API

from dataclasses import dataclass
from typing import Iterable, Literal, Optional

LocationType = Literal["spreadsheet", "sheet"]

@dataclass
class MetadataEntry:
    key: str
    value: str
    location_type: LocationType
    sheet_title: Optional[str] = None  # required when location_type == "sheet"

@dataclass
class MetadataRecord(MetadataEntry):
    metadata_id: int

def register_metadata(spreadsheet_id: str, entries: Iterable[MetadataEntry]) -> list[MetadataRecord]:
    """Create or replace metadata entries per key/location and return saved records with metadata ids."""

def list_metadata(spreadsheet_id: str, *, key_prefix: Optional[str] = None, location: Optional[str] = None, sheet_title: Optional[str] = None) -> list[MetadataRecord]:
    """Return existing metadata filtered by optional key prefix and location/sheet filters, sorted by key then sheet title."""

def update_metadata(spreadsheet_id: str, key: str, new_value: str, *, location: Optional[str] = None, sheet_title: Optional[str] = None) -> list[MetadataRecord]:
    """Update value for metadata entries matching key and optional location filter; return updated records."""

def remove_metadata(spreadsheet_id: str, key: str, *, location: Optional[str] = None, sheet_title: Optional[str] = None) -> int:
    """Remove metadata entries matching key and filters, returning count removed."""

Dependencies { .dependencies }

pygsheets { .dependency }

Provides Google Sheets access and developer metadata management utilities.

Version

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