This repository has been archived by the owner on Feb 8, 2023. It is now read-only.
forked from covid19india/data
-
Notifications
You must be signed in to change notification settings - Fork 7
Google Sheets
Vivek Shrinivasan edited this page Dec 2, 2021
·
2 revisions
After taking up responsibility from covid19india.org team, we haven't changed much of the workflow. Especially the way data is read from google sheets and the scripts that run on github actions that generates the endpoint.
This blog is an attempt to simplify the process that covid19india team took (read about how they did it over here)
- Duplicate the existing google sheet file into the same directory
- Delete all content from the
Raw_Data
sheet - Rename the file with the following nomenclature
2021-12-02_covid19bharat_v36_dec02
(date should be the date on which you start entering into this new sheet. For version, use the previous version + 1) - Update the
sheets-to-csv.js
file in thesrc/
folder over here with the following- Publish the new google sheet (File > Share > Publish to web) & copy the url
- In the js file, create a new variable eg:
const PUBLISHED_SHEET_ID_36 =
and assign only the id part of the url (remove everything else) - Create another variable
const SHEETS_V36
containing a list of all sheet names and sheet ids (usually this will remain the same after you duplicate the sheet file on gdrive, no changes should be required here) - Edit the previous sheet id's variable to something like
[["raw_data35", "0"]]
- At the end of the file update only to read the most recent 2 sheets
await sheetsToCSV(SHEETS_V35, PUBLISHED_SHEET_ID_36);