Skip to content

Commit f6421b6

Browse files
committed
update flight_data class
1 parent 3626cfc commit f6421b6

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import requests
2-
import os
3-
from datetime import datetime
42

53

64
class DataManager:
@@ -11,7 +9,7 @@ def __init__(self, api_key: str):
119
'Authorization': f'Basic {api_key}'
1210
}
1311

14-
def get_flights_from_google_sheet(self):
12+
def get_flights_from_google_sheet(self) -> dict:
1513
try:
1614
response = requests.get(self.__API_URL, headers=self.__HEADERS)
1715
response.raise_for_status()
@@ -21,5 +19,5 @@ def get_flights_from_google_sheet(self):
2119
print(f"Error in request: {err}")
2220

2321

24-
test = DataManager(api_key="")
22+
test = DataManager(api_key="dGVzdFJ1YmVuOlBhc3N3MHJk")
2523
print(test.get_flights_from_google_sheet())

FlightDealsStart/flight_data.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from FlightDealsStart.data_manager import DataManager
2+
3+
class FlightData:
4+
#This class is responsible for structuring the flight data.
5+
6+
def __init__(self, api_key: str):
7+
self.__flights = DataManager(api_key).get_flights_from_google_sheet()
8+
9+
def struct_flights(self):
10+
flights = self.__flights["prices"]
File renamed without changes.

flight-deals-start/flight_data.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)