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

Drive Access Toolkit

Manage spreadsheet permissions and file placement/export operations for Google Drive-backed spreadsheets.

Capabilities

Grant and inspect user access

  • Granting writer access to a user email for an existing spreadsheet id returns a permission summary that includes that email with a writer role and user type. @test
  • Revoking a previously granted user removes that email from the permission summary returned afterward. @test

Relocate spreadsheets to folders

  • Moving a spreadsheet to a folder id returns a shareable URL and parent id list that includes the target folder. @test

Export spreadsheets as files

  • Exporting a spreadsheet to PDF writes a non-empty file to the provided path and returns that path. @test

Implementation

@generates

API

from typing import List, TypedDict

class PermissionEntry(TypedDict):
    email: str
    role: str
    type: str

class MoveResult(TypedDict):
    url: str
    parent_ids: List[str]

class DriveAccessManager:
    def grant_access(self, spreadsheet_id: str, email: str, role: str, notify: bool = False) -> List[PermissionEntry]:
        """Grant access for email with role (e.g., 'reader', 'writer'); optionally send notification; return updated permissions."""

    def revoke_access(self, spreadsheet_id: str, email: str) -> List[PermissionEntry]:
        """Remove access for email and return updated permissions."""

    def move_to_folder(self, spreadsheet_id: str, folder_id: str) -> MoveResult:
        """Move spreadsheet to folder and return its new shareable URL with parent ids reflecting the target folder."""

    def export_spreadsheet(self, spreadsheet_id: str, export_format: str, output_path: str) -> str:
        """Export spreadsheet to given format (e.g., 'pdf') at output_path and return the written file path."""

Dependencies { .dependencies }

pygsheets { .dependency }

Python client for Google Sheets and Drive operations, covering sharing, moving, exporting, and permission management.

Version

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