Example #1
0
    print("-----------------------------------")
    ppr.pprint(response.data)
except ResponseError as error:
    print(error)

# Hotels query
try:
    response = amadeus.shopping.hotel_offers.get(cityCode='LON')
    print("-----------------------------------")
    print("HOTELS")
    print("-----------------------------------")
    for h in response.data:
        ppr.pprint(h['hotel']['name'])
    print('---')
    # Siguientes paginas de resultados
    response = amadeus.next(response)
    for h in response.data:
        ppr.pprint(h['hotel']['name'])
    print('---')
    response = amadeus.next(response)
    for h in response.data:
        ppr.pprint(h['hotel']['name'])

except ResponseError as error:
    print(error)


# Activities query
try:
    response = amadeus.shopping.activities.by_square.get(north=41.397158, west=2.160873,
                                          south=41.394582, east=2.177181)
Example #2
0
trip_long = trip.lat_long[1]
city_radius = 1
try:
    response = amadeus.reference_data.locations.points_of_interest.get(
        latitude=trip_lat, longitude=trip_long, radius=city_radius)
except ResponseError as error:
    print(error)

locations_list.append(parseAmadeus(response.data))
kp_info.append(createValueList(locations_list[0], profile, trip))
values_list.append(kp_info[0][0])
weights_list.append(kp_info[0][1])
weight_limit.append(profile.hours_awake() * trip.num_days())

i = 0
while amadeus.next(response) is not None:
    try:
        i += 1
        response = amadeus.next(response)
        locations_list.append(parseAmadeus(response.data))
        kp_info.append(createValueList(locations_list[i], profile, trip))
        values_list.append(kp_info[i][0])
        weights_list.append(kp_info[i][1])
        weight_limit.append(profile.hours_awake() * trip.num_days())
        print(response)
    except ResponseError as error:
        print(error)
'''
Creates a top recommendation list of events for the user in addition to less 
personalized events list 
'''