Inserting data via streamlit form to Google sheets

This is the code for inserting new data to the sheet

import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']

creds = ServiceAccountCredentials.from_json_keyfile_name('testingdb-b6d4d-d0a2646c069a.json', scope)
client = gspread.authorize(creds)
 
sh = client.open('TestSheet').worksheet('names')  
row = [name,adr,age,symptoms,gender,email]
sh.append_row(row)
3 Likes