iterative / PyDrive2

Google Drive API Python wrapper library. Maintained fork of PyDrive.
https://docs.iterative.ai/PyDrive2
Other
565 stars 70 forks source link

How do I write to specific tab? #308

Open cameronjohnson-mz opened 10 months ago

cameronjohnson-mz commented 10 months ago

@rlamy or anyone who can help.

I currently have CSV data that I can write to the first tab, but how can look over the sheets and write to each one? And can someone update the documentation about spreadsheets because there's no information about it.

google_file_ref = next(iter(drive.ListFile({'q':f"mimeType = 'application/vnd.google-apps.spreadsheet' and '{google_file_ref_id}' in parents and trashed=false",
        'maxResults': 10,
        'corpora': 'teamDrive',
        'teamDriveId': drive_id,
        'includeTeamDriveItems': True,
        'supportsTeamDrives': True}).GetList()))
google_file_ref.SetContentString(response.content.decode('utf-8'))
google_file_ref.Upload()
shcheklein commented 10 months ago

I don't think we have an API to write to specific tab.