parser.py
def priceParser(infoDict: dict, price: int):
	'''
	infoDict: Dictionary of restaurant information
	rating: Int representing minimum restaraunt rating you prefer
	return: list of price sorted restaraunt info (dictionary containing all restaraunt data), list of restataunt basic info (name & image)
	'''
	parsedInfo = []
	'''Contains parsed restaraunts name, rating and image url'''
	basicInfo = []

	for place in infoDict['results']:
		try:
			if (place['price_level'] <= price):
				parsedInfo.append(place)
				photoURL = buildPhotoURL(place['photos'][0]['photo_reference'], 500)
				basicInfo.append((place['name'], place['rating'], photoURL))
		except:
			pass
			#("No price")

	parsedInfo = sorted(parsedInfo, key = lambda pI: pI['rating'], reverse = True)
	basicInfo = sorted(basicInfo, key = lambda bI: bI[1], reverse = True)

	return parsedInfo, basicInfo

	infoDict: Dictionary of restaurant information
	rating: Int representing minimum restaraunt rating you prefer
	return: list of price sorted restaraunt info (dictionary containing all restaraunt data), list of restataunt basic info (name & image)
	
Dictionary of restaurant information
rating: Int representing minimum restaraunt rating you prefer
return: list of price sorted restaraunt info (dictionary containing all restaraunt data), list of restataunt basic info (name & image)
Dictionary of restaurant information rating : Int representing minimum restaraunt rating you prefer return : list of price sorted restaraunt info ( dictionary containing all restaraunt data ) list of restataunt basic info ( name & image )
def priceParser(infoDict: dict, price: int):
	parsedInfo = []
	basicInfo = []
	for place in infoDict['results']:
		try:
			if (place['price_level'] <= price):
				parsedInfo.append(place)
				photoURL = buildPhotoURL(place['photos'][0]['photo_reference'], 500)
				basicInfo.append((place['name'], place['rating'], photoURL))
		except:
			pass
	parsedInfo = sorted(parsedInfo, key = lambda pI: pI['rating'], reverse = True)
	basicInfo = sorted(basicInfo, key = lambda bI: bI[1], reverse = True)
	return parsedInfo, basicInfo
def priceParser ( infoDict : dict , price : int ) : parsedInfo = [ ] '''Contains parsed restaraunts name, rating and image url''' basicInfo = [ ] for place in infoDict [ 'results' ] : try : if ( place [ 'price_level' ] <= price ) : parsedInfo . append ( place ) photoURL = buildPhotoURL ( place [ 'photos' ] [ 0 ] [ 'photo_reference' ] , 500 ) basicInfo . append ( ( place [ 'name' ] , place [ 'rating' ] , photoURL ) ) except : pass parsedInfo = sorted ( parsedInfo , key = lambda pI : pI [ 'rating' ] , reverse = True ) basicInfo = sorted ( basicInfo , key = lambda bI : bI [ 1 ] , reverse = True ) return parsedInfo , basicInfo
infoDict: Dictionary of restaurant information
rating: Int representing minimum restaraunt rating you prefer
return: list of price sorted restaraunt info (dictionary containing all restaraunt data), list of restataunt basic info (name & image)
infoDict : Dictionary of restaurant information rating : Int representing minimum restaraunt rating you prefer return : list of price sorted restaraunt info ( dictionary containing all restaraunt data ) list of restataunt basic info ( name & image )
'''
	infoDict: Dictionary of restaurant information
	rating: Int representing minimum restaraunt rating you prefer
	return: list of price sorted restaraunt info (dictionary containing all restaraunt data), list of restataunt basic info (name & image)
	''' '''Contains parsed restaraunts name, rating and image url''' #("No price")
infoDict
dict
price
int