A task to read data from csv file (located on a local server) and then write it to a defined Google sheets
i) Go to => Google Console Link ii) Create a project as shown in snapshot below
i) Go to Enabled API and services as shown in the figure below
ii) Click on Enable API and Services as shown in figure below
iii) Click on Enable as shown in the figure below
i) Go to APIs and Services and click on create credentials (as shown in figure below) ii) Click on Service Accounts (as shown in the figure below). iii) Make sure to select Project and then afterwards Owner (as shwon in the figure below)
i) Create a project in Python environment. For that purpose I have already created a virtaul environment. And Python 3.X version is installed. ii) Move the create credentials.json file to the environment and save it there.
I am using Pycharm. But Visual Studio Code is a good choice as well. i) Create a new project and name it as you like. ii) Move the credentials.json file and move it to this project. Note:: I have removed this json file as it is a good practice to use .gitignore to remove such files before committing the code.
Step 7: Create a virtual environment, start writing the script and install all the required libraries.
i) I did my research already and the requirements of all libraries that are required for me are put into requirements.txt. Also a virtual environment is created already. ii) Moreover a test.csv is defined as well. iii) Also I have started writing the main file.
After setting up the virtual environment, install all the required libraries as mentioned in requirements.txt. The whole code is available under the main.py file.