It is very common when working with data sets in python to save processed data onto a local spreadsheet file. After which you will attached and send such a file to other users in some other locations. In a situation where you want the spreadsheet file to be readily available to those users as you push in process data, then you need to share a cloud hosted spreadsheet such as 'Google Sheet'.
So, in this post I will share with you how you can use python to connect to a 'Google Sheet' located in your Google Drive and push in data right from a python script running on your local machine. This post will guide you on loading data from a local python script into cloud based spreadsheet (Google Sheet).
Let's get started...
1) Configuring Google account
a) Go to: https://console.cloud.google.com/apis/dashboard and create a new project, give it a name and open it. You can use existing project if you already created one before.
Here my project is named “PySpreadSheetExample”.
b) Open the project and enable “Google Drive API” and “Google Sheet API” by clicking on ‘Enable API and Services’ button.
So, in this post I will share with you how you can use python to connect to a 'Google Sheet' located in your Google Drive and push in data right from a python script running on your local machine. This post will guide you on loading data from a local python script into cloud based spreadsheet (Google Sheet).
Let's get started...
Python Google Sheet setup instructions
1) Configuring Google account
a) Go to: https://console.cloud.google.com/apis/dashboard and create a new project, give it a name and open it. You can use existing project if you already created one before.
Here my project is named “PySpreadSheetExample”.
b) Open the project and enable “Google Drive API” and “Google Sheet API” by clicking on ‘Enable API and Services’ button.
You will search for “Google Drive API” and “Google Sheet API” and click on the ‘Enable’ button for each.