fly_tracker package

Submodules

fly_tracker.Notifier module

class fly_tracker.Notifier.Notifier(email: str, data: DataFrame, scraper: PriceScraper)[source]

Bases: object

Notifier class that sends email notification with the scraped data

create_message()[source]

Create a message object and set the subject and body

Returns:

MIMEMultipart: Email Content

send_mail(msg: MIMEMultipart)[source]

Create email body and send scraped flight fare data

Args:

msg (MIMEMultipart): Email to be sent

fly_tracker.Scraper module

Scrapes and returns a csv file with airline price data Returns:

pd.Dataframe: Airfare price data between src and dest

class fly_tracker.Scraper.PriceScraper(src: str, dest: str, price: int, date: str)[source]

Bases: object

Scraper class that scrapes google flights

create_df(data: list[dict]) DataFrame[source]

Helper function to convert data into a Pandas Dataframe

Args:

data (list[dict]): Flight Information data

Returns:

pd.DataFrame: data in the form of a pandas Dataframe

get_page()[source]

Load dynamic chrome browser and return page source to scrape

parser(soup: BeautifulSoup) list[dict][source]

Helper parser function that scrapes required details

Args:

soup (BeautifulSoup): Soup object to scrape

Returns:

list[dict]: list of dictionaries which store scraped flight information records

preprocess() None[source]

Helper Preprocessing function

soupify(page: str) BeautifulSoup[source]

Return page to scrape as a BeautifulSoup object Args:

page (str): Source page

Returns:

BeautifulSoup: parsed bs4 object

Module contents