change key path

This commit is contained in:
Pritimay Sarkar
2023-09-25 10:42:30 +05:30
parent e7e03e1292
commit f2817da52a
4 changed files with 6 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ if __name__ == "__main__":
else:
path_delim = '/'
key_file_path = os.getcwd() + path_delim + "keys" + path_delim + "hpos-prod-firebase-adminsdk-bionp-3c041b2300.json"
key_file_path = os.getcwd() + path_delim + "keys" + path_delim + "hpos-preprod-firebase-adminsdk.json"
cred = credentials.Certificate(key_file_path) # Replace with your own service account key path
firebase_admin.initialize_app(cred)
@@ -66,7 +66,7 @@ if __name__ == "__main__":
# Convert the data to a DataFrame
df = pd.DataFrame(data)
# print(df)
print(df)
print(df.size)
# Save the DataFrame to a CSV file

View File

@@ -6,7 +6,7 @@ from google.cloud.firestore_v1.base_query import FieldFilter
if __name__ == "__main__":
file_path = os.getcwd() + '/keys' + '/hpos-prod-firebase-adminsdk-bionp-3c041b2300.json'
file_path = os.getcwd() + '/keys' + '/hpos-prod-firebase-adminsdk.json'
cred = firebase_admin.credentials.Certificate(fr'{file_path}')
firebase_admin.initialize_app(cred)

View File

@@ -6,10 +6,9 @@ from google.cloud.firestore_v1.base_query import FieldFilter
import pandas as pd
from datetime import datetime
import sys
import os
# Initialize Firebase Admin SDK
cred = credentials.Certificate(os.getcwd() + '/' + 'keys/hpos-prod-firebase-adminsdk-bionp-3c041b2300.json') # Replace with your own service account key path
cred = credentials.Certificate(os.getcwd() + '/' + 'keys/hpos-prod-firebase-adminsdk.json') # Replace with your own service account key path
firebase_admin.initialize_app(cred)
# Get a reference to the Firestore database
@@ -53,7 +52,7 @@ df = pd.DataFrame(data)
print(df)
print(df.size)
df = df[["_id", "classificationResult", "calculatedRatio", "deviceId", "deviceRatio", "deviceType", "kitSerial", "led1Average", "led1Buffer", "led1Sample", "led2Average", "led2Buffer", "led2Sample", "location", "deviceSerialNumber", "name", "testTime"]]
df = df[["_id", "classificationResult", "calculatedRatio", "deviceId", "deviceRatio", "deviceType", "kitSerial", "led1Average", "led1Buffer", "led1Sample", "led2Average", "led2Buffer", "led2Sample", "location", "deviceSerialNumber", "name", "testTime", "resultData"]]
# Save the DataFrame to a CSV file
output_filename = f'tests_{datetime.today().strftime("%d_%m_%Y_%H_%M")}.xlsx'

View File

@@ -6,7 +6,7 @@ from google.cloud.firestore_v1.base_query import FieldFilter
if __name__ == "__main__":
file_path = os.getcwd() + '/keys' + '/hpos-prod-firebase-adminsdk-bionp-3c041b2300.json'
file_path = os.getcwd() + '/keys' + '/hpos-prod-firebase-adminsdk.json'
cred = firebase_admin.credentials.Certificate(fr'{file_path}')
firebase_admin.initialize_app(cred)