def makeQuery(query): if inputfile == '': print("Connecting to: " + query); xml = firebase.curlQuery("http://data.fmi.fi" + query) xml_root = ET.fromstring(xml) else: print("Reading xml file: " + inputfile) xml_root = ET.parse(inputfile) parseXMLtoJSON(xml_root)
def getUserData(firebase_url, user_id): query = "/users.json" if user_id: query = "/users/" + user_id + ".json" print("Connecting to: " + query); datalist = json.loads(firebase.curlQuery(firebase_url + query)) userlist = [] if user_id: #print (json.dumps(datalist)) userlist.append(datalist) else: for key in datalist: #print (json.dumps(datalist[key])) userlist.append(datalist[key]) return userlist
def getAllDriverData(firebase_url, year): query = "/drivers/" + year + ".json" print("Connecting to: " + query); return json.loads(firebase.curlQuery(firebase_url + query))
def getAllCalendarData(firebase_url, year): query = "/calendar/" + year + ".json" print ("Connecting to: " + query) return json.loads(firebase.curlQuery(firebase_url + query))