Last active
September 4, 2022 22:24
-
-
Save rbtrsv/fe5c6bfed5dc196b7e80fe243baadc42 to your computer and use it in GitHub Desktop.
Revisions
-
rbtrsv revised this gist
Sep 4, 2022 . 1 changed file with 13 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,20 @@ import pandas as pd # The is an alternative # from google.cloud import firestore # db = firestore.Client() # db = firestore.Client.from_service_account_json("/Users/your.name/yada-yada-firebase-adminsdk.json") import firebase_admin from firebase_admin import credentials from firebase_admin import firestore cred = credentials.Certificate('/Users/your.name/yada-yada-firebase-adminsdk.json') app = firebase_admin.initialize_app(cred) db = firestore.client() df = pd.DataFrame() for indices, row in df.iterrows(): -
rbtrsv revised this gist
Aug 30, 2022 . 1 changed file with 11 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,4 +3,14 @@ db = firestore.Client() # db = firestore.Client.from_service_account_json("/Users/your.name/yada-yada-firebase-adminsdk.json") df = pd.DataFrame() for indices, row in df.iterrows(): doc_ref = db.collection("stocks").document(row['Symbol']) doc_ref.set({ "Symbol": row['Symbol'], "Name": row['Name'], "Sector": row['Sector'] }) -
rbtrsv created this gist
Aug 30, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ import pandas as pd from google.cloud import firestore db = firestore.Client() # db = firestore.Client.from_service_account_json("/Users/your.name/yada-yada-firebase-adminsdk.json") stocks = list(db.collection(u'stocks').stream())