import fiona import requests import utm from geopy.geocoders import Nominatim import time import json from server2022_new import server2022 import firebase_admin from firebase_admin import credentials from firebase_admin import db from firebase_admin import messaging from firebase_admin import firestore import time import threading import os cred = credentials.Certificate('servicekey.json') try: firebase_admin.initialize_app(cred, {'databaseURL': 'https://farmbase-b2f7e-31c0c.firebaseio.com/'}) except: print('fire running') filepath = 'Downloads/villages.json' dbF = firestore.client() mainObj = {} polygonNum = 0 rr = 1 with open(filepath) as f: data = json.load(f) for fieldid in data: fieldid =str(fieldid) db.reference('PaidMonitoredFields').child('PMF').child('snQYQZqQx3SmVbRztmEqYn5Mkcz2').child(fieldid).child('Paused').set('no') city_ref = dbF.collection("snQYQZqQx3SmVbRztmEqYn5Mkcz2").document(fieldid) # Set the capital field city_ref.update({"Paused": "no"}) time.sleep(0.1)