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

Shared Drive Sheet Manager

Utilities for working with spreadsheets that live inside a shared drive, including enabling shared-drive access, creating new files in shared-drive folders, moving them between folders, and listing them with shared-drive scoping applied.

Capabilities

Enable shared-drive client

  • Returns an authenticated sheets client that is scoped to the provided shared-drive id; raises a ValueError when the id is empty. @test

Create spreadsheet in shared drive

  • Creates a spreadsheet with the given title inside the specified shared-drive folder and returns metadata containing its file id, title, and parent folder id. @test

Move spreadsheet between shared-drive folders

  • Moves an existing spreadsheet from one shared-drive folder to another and returns updated parent folder metadata reflecting the move. @test

List shared-drive spreadsheets

  • Lists spreadsheets inside the shared drive, optionally filtered by title prefix, returning file ids and titles while excluding files outside the shared drive. @test

Implementation

@generates

API

from typing import List, Dict, Any

def enable_shared_drive(credential_source: str, shared_drive_id: str):
    """Return an authenticated sheets client configured to operate on the shared drive."""

def create_shared_drive_sheet(client, title: str, folder_id: str) -> Dict[str, Any]:
    """Create a spreadsheet in the shared drive folder and return metadata including id, title, and parent folder id."""

def move_sheet_within_drive(client, file_id: str, source_folder_id: str, target_folder_id: str) -> Dict[str, Any]:
    """Move a spreadsheet between folders in the shared drive and return updated parent folder metadata."""

def list_shared_drive_sheets(client, title_prefix: str = "") -> List[Dict[str, str]]:
    """List spreadsheets in the shared drive, optionally filtered by title prefix, returning file ids and titles."""

Dependencies { .dependencies }

pygsheets { .dependency }

Python client for Google Sheets and Drive, used to authorize access, scope operations to a shared drive, create spreadsheets, move files, and list spreadsheets.

Version

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