Spaces:
Sleeping
Sleeping
Update annotator.py
Browse files- annotator.py +1 -16
annotator.py
CHANGED
|
@@ -18,25 +18,10 @@ import matplotlib.pyplot as plt
|
|
| 18 |
logging.basicConfig(level=logging.DEBUG)
|
| 19 |
logger = logging.getLogger(__name__)
|
| 20 |
|
| 21 |
-
service_creds = {
|
| 22 |
-
'speadsheet': st.secrets['spreadsheet'],
|
| 23 |
-
'worksheet': st.secrets['worksheet'],
|
| 24 |
-
'type': st.secrets['type'],
|
| 25 |
-
'project_id': st.secrets['project_id'],
|
| 26 |
-
'private_key_id': st.secrets['private_key_id'],
|
| 27 |
-
'private_key': st.secrets['private_key'],
|
| 28 |
-
'client_email': st.secrets['client_email'],
|
| 29 |
-
'client_id': st.secrets['client_id'],
|
| 30 |
-
'auth_uri': st.secrets['auth_uri'],
|
| 31 |
-
'token_uri': st.secrets['token_uri'],
|
| 32 |
-
'auth_provider_x509_cert_url':st.secrets['auth_provider'],
|
| 33 |
-
'client_x509_cert_url': st.secrets['client_cert_url']
|
| 34 |
-
}
|
| 35 |
-
|
| 36 |
@st.cache_resource
|
| 37 |
def authorize_google_sheets():
|
| 38 |
scope = ["https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/drive"]
|
| 39 |
-
creds = service_account.Credentials.from_service_account_info(
|
| 40 |
client = gspread.authorize(creds)
|
| 41 |
return client
|
| 42 |
|
|
|
|
| 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 |
|