Project

General

Profile

Feature #3809

Updated by Ram Kordale 16 days ago

Google sheet to be used: https://docs.google.com/spreadsheets/d/1F5aDBK0GlwCZjxbegE0909rr3sgbsHD_LepQlgRCzEA/edit?gid=0#gid=0 

 Input would come from a file containing zero or more of: 
 server=dev|qa|prod 
 board=<board> 
 grade=<grade> 
 subject=<subject> 
 threshold=X 

 If the input file does not exist or is empty or does not have some key value pairs, assume all matching values. For example, if the input file does not exist, then the query would be all boards, grades and subjects. Also, if threshold is not available, assume X is 0. 

 Google sheet would contain zero or more entries with the following columns: board, grade, subject, style, chapter, exercise_number. 


 Sample code: 

 !pip install --upgrade gspread google-auth 
 import gspread 
 from google.colab import auth 
 from google.auth import default 

 # Authenticate and create the PyDrive client. 
 auth.authenticate_user() 
 creds, _ = default() 
 gc = gspread.authorize(creds) 

 # Replace 'Your Spreadsheet Name' with the actual name of your Google Sheet 
 spreadsheet = gc.open('Your Spreadsheet Name') 

 # Select the first sheet 
 worksheet = spreadsheet.sheet1 

 rows = worksheet.get_all_values() 

 #do processing 

 # Example: Update a specific cell 
 worksheet.update_acell('A1', 'Updated Value') 

 # Example: Append a new row 
 new_row = ['Value1', 'Value2', 'Value3'] 
 worksheet.append_row(new_row) 

Back