Google Spreadsheets Python API v4
76
Manage spreadsheet permissions and file placement/export operations for Google Drive-backed spreadsheets.
@generates
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."""Python client for Google Sheets and Drive operations, covering sharing, moving, exporting, and permission management.
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