pedutronix commited on
Commit
c86b5e6
·
verified ·
1 Parent(s): 514a270

Update config.py

Browse files
Files changed (1) hide show
  1. config.py +10 -0
config.py CHANGED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import os, base64, tempfile
2
+
3
+ def set_environment():
4
+ b64 = os.getenv("GCP_CREDS_B64")
5
+ key_bytes = base64.b64decode(b64)
6
+ with tempfile.NamedTemporaryFile(delete=False, suffix=".json") as tmp:
7
+ tmp.write(key_bytes)
8
+ tmp_path = tmp.name
9
+
10
+ os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = tmp_path