msagbohan commited on
Commit
74fc871
·
verified ·
1 Parent(s): 77db9ac

Update annotator.py

Browse files
Files changed (1) hide show
  1. annotator.py +4 -1
annotator.py CHANGED
@@ -1,5 +1,6 @@
1
  import streamlit as st
2
  import os
 
3
  import pandas as pd
4
  import gspread
5
  from google.oauth2 import service_account
@@ -18,10 +19,12 @@ import matplotlib.pyplot as plt
18
  logging.basicConfig(level=logging.DEBUG)
19
  logger = logging.getLogger(__name__)
20
 
 
 
21
  @st.cache_resource
22
  def authorize_google_sheets():
23
  scope = ["https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/drive"]
24
- creds = service_account.Credentials.from_service_account_info(st.secrets["gcp_service_account"], scopes=scope)
25
  client = gspread.authorize(creds)
26
  return client
27
 
 
1
  import streamlit as st
2
  import os
3
+ import ast
4
  import pandas as pd
5
  import gspread
6
  from google.oauth2 import service_account
 
19
  logging.basicConfig(level=logging.DEBUG)
20
  logger = logging.getLogger(__name__)
21
 
22
+ sh_auth = ast.literal_eval(gcp_service_account)
23
+
24
  @st.cache_resource
25
  def authorize_google_sheets():
26
  scope = ["https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/drive"]
27
+ creds = service_account.Credentials.from_service_account_info(sh_auth, scopes=scope)
28
  client = gspread.authorize(creds)
29
  return client
30