-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmain.py
31 lines (22 loc) · 1.19 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#This file will need to use the DataManager,FlightSearch, FlightData, NotificationManager classes to achieve the program requirements.
from pprint import pprint
from data_manager import DataManager
from flight_search import FlightSearch
from notification_manager import NotificationManager
data_manager = DataManager()
sheet_data = data_manager.get_sheety_data()
# pprint(DataManager().getSheetyData())
flight_search = FlightSearch()
for row_index, row in enumerate(sheet_data):
if row["iataCode"] == "":
# data started on row 2
data_manager.edit_row_iata_code(row_index=row_index+2, iata_code=flight_search.find_iata_code(row["city"]))
ORIGIN_CITY_IATA = "ABV"
# notification_manager = NotificationManager()
for destination in sheet_data:
flight = flight_search.find_flight_prices(ORIGIN_CITY_IATA, destination["iataCode"])
print(flight)
# if flight.price < destination["lowestPrice"]:
# notification_manager.send_sms(
# message=f"Low price alert! Only £{flight.price} to fly from {flight.origin_city}-{flight.origin_airport} to {flight.destination_city}-{flight.destination_airport}, from {flight.out_date} to {flight.return_date}."
# )