ak0601 commited on
Commit
504c667
·
verified ·
1 Parent(s): f9e9765

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -14
app.py CHANGED
@@ -14,21 +14,23 @@ load_dotenv()
14
  GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
15
  FIRECRAWL_API_KEY = os.getenv("FIRECRAWL_API_KEY")
16
  SHEET_ID = os.getenv("SHEET")
 
 
17
  # Setup Google Sheets connection (update the path and sheet name)
18
- genai ={
19
- "type": str(os.getenv("type")),
20
- "project_id": str(os.getenv("project_id")),
21
- "private_key_id": str(os.getenv("private_key_id")),
22
- "private_key": str(os.getenv("private_key")),
23
- "client_email": str(os.getenv("client_email")),
24
- "client_id": str(os.getenv("client_id")),
25
- "auth_uri": str(os.getenv("auth_uri")),
26
- "token_uri": str(os.getenv("token_uri")),
27
- "auth_provider_x509_cert_url": str(os.getenv("auth_provider_x509_cert_url")),
28
- "client_x509_cert_url": str(os.getenv("client_x509_cert_url")),
29
- "universe_domain": str(os.getenv("universe_domain"))
30
- }
31
- gc = gspread.service_account_from_dict(genai)
32
  sh = gc.open_by_key(SHEET_ID) # Replace with your Google Sheet name
33
  worksheet = sh.worksheet("S1") # Replace with your worksheet name if different
34
 
 
14
  GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
15
  FIRECRAWL_API_KEY = os.getenv("FIRECRAWL_API_KEY")
16
  SHEET_ID = os.getenv("SHEET")
17
+ cred_dic = os.getenv("cred_dict")
18
+ cred_dict = json.loads(cred_dic)
19
  # Setup Google Sheets connection (update the path and sheet name)
20
+ # genai ={
21
+ # "type": str(os.getenv("type")),
22
+ # "project_id": str(os.getenv("project_id")),
23
+ # "private_key_id": str(os.getenv("private_key_id")),
24
+ # "private_key": str(os.getenv("private_key")),
25
+ # "client_email": str(os.getenv("client_email")),
26
+ # "client_id": str(os.getenv("client_id")),
27
+ # "auth_uri": str(os.getenv("auth_uri")),
28
+ # "token_uri": str(os.getenv("token_uri")),
29
+ # "auth_provider_x509_cert_url": str(os.getenv("auth_provider_x509_cert_url")),
30
+ # "client_x509_cert_url": str(os.getenv("client_x509_cert_url")),
31
+ # "universe_domain": str(os.getenv("universe_domain"))
32
+ # }
33
+ gc = gspread.service_account_from_dict(cred_dict)
34
  sh = gc.open_by_key(SHEET_ID) # Replace with your Google Sheet name
35
  worksheet = sh.worksheet("S1") # Replace with your worksheet name if different
36