Spaces:
Build error
Build error
Update app.py
Browse files141 unmodified lines142143144145146147148145146147148149150151141 unmodified lines
# Setup Google Sheets data fetchdef get_google_sheet_data(sheet_id, range_name): creds = service_account.Credentials.from_service_account_info( st.secrets["gcp_service_account"], scopes=["https://www.googleapis.com/auth/spreadsheets.readonly"], ) # Define the Google Sheets API scope scopes = ["https://www.googleapis.com/auth/spreadsheets"] creds = Credentials.from_service_account_file("credentials.json", scopes=scopes) client = gspread.authorize(creds) service = build("sheets", "v4", credentials=creds) sheet = service.spreadsheets() result = sheet.values().get(spreadsheetId=sheet_id, range=range_name).execute()app.py+4-4