from array import array from server2022_new import server2022 import firebase_admin from firebase_admin import credentials from firebase_admin import db from firebase_admin import messaging import time import threading import os import pandas as pd from numba import jit, cuda import requests cred = credentials.Certificate('servicekey.json') uid = 'mFFHQdEtiSbn2hbYQAwwoIdYVi02' try: firebase_admin.initialize_app(cred, {'databaseURL': 'https://farmbase-b2f7e-31c0c.firebaseio.com/'}) except: print('fire running') mainArr = [] tempObj = {} mainArr.append(['Field ID', 'Field Address']) try: pending_list = db.reference('PaidMonitoredFields').child('PMF').child(uid).get() for (p,q) in pending_list.items(): try: fieldAdresss = q["FieldAddress"] farmArr = [] farmArr.append(p) farmArr.append(fieldAdresss) mainArr.append(farmArr) except Exception as e: print(e) df = pd.DataFrame(mainArr).T df.to_excel(excel_writer='ttg_main.xlsx') except Exception as e: print(e) print('a2')