Up until this point, we've worked within the Jupyter Notebook, but now, in order to deploy our app, we'll move on to working in a text editor. The notebook is excellent for exploratory analysis and visualization, but running a background job is best done within a simple .py file. So, let's get started.
We'll begin with our imports. You may need to pip install a few of these if you don't already have them installed:
import sys import sys import numpy as np from bs4 import BeautifulSoup from selenium import webdriver import requests import scipy from PyAstronomy import pyasl from datetime import date, timedelta, datetime import time from time import sleep import schedule
Next, we'll create a function that pulls down the data and runs our algorithm:
def check_flights(): # replace this with the path of where you...