14 dec data

This commit is contained in:
Pritimay Sarkar
2023-12-14 21:03:09 +05:30
parent 6bd972276f
commit 7bcdbff123
18 changed files with 237 additions and 16 deletions

View File

@@ -15,11 +15,11 @@ firebase_admin.initialize_app(cred)
db = firestore.client()
patient_collection = db.collection("patientData")
# test_collection = db.collection("testData")
test_collection = db.collection("testData")
start_date = sys.argv[1]
end_date = sys.argv[2]
query = patient_collection.where(filter=FieldFilter("createdAt", ">=", start_date)).where(filter=FieldFilter("createdAt", "<", end_date))
query = patient_collection #.where(filter=FieldFilter("createdAt", ">=", start_date)).where(filter=FieldFilter("createdAt", "<", end_date))
patient_docs = query.stream()
data = []
@@ -33,6 +33,8 @@ print(df.size)
print("duplicates", len(df['_id']) - len(df['_id'].drop_duplicates()))
df = df.sort_values('bloodGroup', na_position='first', ascending=False).drop_duplicates('_id').sort_index()
output_filename = f'users_{datetime.today().strftime("%d_%m_%Y_%H_%M")}.xlsx'
df.to_excel(output_filename, index=False)