Khurrm / csv_to_google_sheets

A task to read data from csv file and then write it to Google sheets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

csv_to_google_sheets

A task to read data from csv file (located on a local server) and then write it to a defined Google sheets

Step 1: Create a Project on Google Console

i) Go to => Google Console Link ii) Create a project as shown in snapshot below

automated like clockwork

Step 2: Enable Goolge Sheets API

i) Go to Enabled API and services as shown in the figure below

automated like clockwork

ii) Click on Enable API and Services as shown in figure below

automated like clockwork

iii) Click on Enable as shown in the figure below automated like clockwork

Step 3: Create a Service Account

i) Go to APIs and Services and click on create credentials (as shown in figure below) Gitu1 ii) Click on Service Accounts (as shown in the figure below). Gitu2 iii) Make sure to select Project and then afterwards Owner (as shwon in the figure below) Gitu3

Step 4: Create a project in Python Environment

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.

Step 6: Open your IDE and start creating a Project project

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.

Step 8: Install the requirements.txt file (that I created) and write the script

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.

About

A task to read data from csv file and then write it to Google sheets


Languages

Language:Python 100.0%