Name two file execution for spreadsheet
Answers
Answered by
0
Hopefully it helps you
In the past two tutorials on Google Drive API with Python, we have covered how to obtain credentials here and search for a specific file in Google Drive by its name here.
In this tutorial, we are going to learn how to download a specific Sheet by name from a Google Spreadsheet into a csv file. A use case for this: you need to generate a report, which data are stored in a Google Spreadsheet that has many Sheets, but you only need one or two of them. So, instead of downloading the whole Google Spreadsheet, you can handpick the Sheets that you need.
Why by its name? Because I’ve learnt from my work experience that people tend to stick to the naming and usually refer to it by its name. For instance, one might ask his or colleague like this, “Can you extract the data from the Revenue sheet, please?.
Anyways, you know what I’m talking about. Let’s just get into it, alright?
TLDR; download the project repo from Github.
Download a Specific Sheet as csv
Our current Python script has the capability to search for a specific file by its name. Let’s modify the script so then it is able to reference a specific Sheet in a Google Spreadsheet and download it as a csv file.
At the end of the tutorial, we will end up with a Python script that is executable from command line and takes two input arguments:
Google Spreadsheet’s name
Sheet name to download as csv
To follow along, please check out this commit of the repo.
In the past two tutorials on Google Drive API with Python, we have covered how to obtain credentials here and search for a specific file in Google Drive by its name here.
In this tutorial, we are going to learn how to download a specific Sheet by name from a Google Spreadsheet into a csv file. A use case for this: you need to generate a report, which data are stored in a Google Spreadsheet that has many Sheets, but you only need one or two of them. So, instead of downloading the whole Google Spreadsheet, you can handpick the Sheets that you need.
Why by its name? Because I’ve learnt from my work experience that people tend to stick to the naming and usually refer to it by its name. For instance, one might ask his or colleague like this, “Can you extract the data from the Revenue sheet, please?.
Anyways, you know what I’m talking about. Let’s just get into it, alright?
TLDR; download the project repo from Github.
Download a Specific Sheet as csv
Our current Python script has the capability to search for a specific file by its name. Let’s modify the script so then it is able to reference a specific Sheet in a Google Spreadsheet and download it as a csv file.
At the end of the tutorial, we will end up with a Python script that is executable from command line and takes two input arguments:
Google Spreadsheet’s name
Sheet name to download as csv
To follow along, please check out this commit of the repo.
Similar questions