How to download a specific sheet from Google Sheet with Pydrive in csv

if I need to download a specific google sheet with Python and pydrive I can use a simple command like this:

drive.CreateFile({'id':'[sheetID]}).GetContentFile('file.csv', mimetype='text/csv')

this works, but, in this case, I download in CSV only the first sheet of the Google File.

If in this file there are multiple sheets and I need to download a specific sheet, maybe by the ID that I can see in the URL "...edit#gid=111115555", how can I change the command?

I'd like to download a sheet regardless the position or the name of this one.

Can you help me?

Thanks in advance



Read more here: https://stackoverflow.com/questions/67384798/how-to-download-a-specific-sheet-from-google-sheet-with-pydrive-in-csv

Content Attribution

This content was originally published by Davide at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: