import requests

def get_weather(city):
    api_key = '1aee5b2855bac524f4923a7ad14cd3e6'  # Replace with your OpenWeatherMap API key
    base_url = "http://api.openweathermap.org/data/2.5/weather?"
    complete_url = base_url + "appid=" + api_key + "&q=" + city + "&units=imperial"
    response = requests.get(complete_url)
    return response.json()

def get_forecast(city):
    api_key = '1aee5b2855bac524f4923a7ad14cd3e6'  # Replace with your OpenWeatherMap API key
    base_url = "http://api.openweathermap.org/data/2.5/forecast?"
    complete_url = base_url + "appid=" + api_key + "&q=" + city + "&units=imperial"
    response = requests.get(complete_url)
    return response.json()

def deg_to_cardinal(deg):
    directions = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW']
    ix = int((deg / 22.5) + 0.5)
    return directions[ix % 16]