Example #1
0
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)
Example #2
0
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
Example #3
0
def getAllDriverData(firebase_url, year):
	query = "/drivers/" + year + ".json"
	print("Connecting to: " + query);
	return json.loads(firebase.curlQuery(firebase_url + query))	
Example #4
0
def getAllCalendarData(firebase_url, year):
    query = "/calendar/" + year + ".json"
    print ("Connecting to: " + query)
    return json.loads(firebase.curlQuery(firebase_url + query))