<jupyter_start><jupyter_text>Take User Input<jupyter_code>user_address = input()<jupyter_output>12042 Rives Ave, Downey, CA<jupyter_text>Data Extraction<jupyter_code>#Extract Data from GoogleMaps, OpenWeather, and Breezometer APIs 

#Geocode the user address to find the location (latitude and longitude) 
gmaps = googlemaps.Client(key=gmaps_key)
geocode_result = gmaps.geocode(user_address)
lat = geocode_result[0]['geometry']['location']['lat']
lng = geocode_result[0]['geometry']['location']['lng']

#get breezometer AQI forecast data 
url = f'https://api.breezometer.com/air-quality/v2/forecast/hourly?lat={lat}&lon={lng}&key={breezometer_key}&hours={48}&features=breezometer_aqi,dominant_pollutant_concentrations'
uv_url = f'https://api.openweathermap.org/data/2.5/onecall?lat={lat}&lon={lng}&exclude=daily,minutely&appid={open_weather_key}'
response = requests.get(url).json()
uv_response = requests.get(uv_url).json()
formatted_address = geocode_result[0]['formatted_address']
# format data
AQI_times = []
AQI = []
uv_index = []

for i in range(len(response['data'])):
    AQI_times.append(response['data'][i]['datetime'])
    AQI.append(response['data'][i]['indexes']['baqi']['aqi']) 

for i in range(48):
    uv_index.append(uv_response['hourly'][i]['uvi'])

#Create Readable Time Data
time = []
local_time =[]
current_time = datetime.now()
time.append(current_time.isoformat())
for i in range(1,48):
    calculated_time = current_time + timedelta(hours=i)
    time.append(calculated_time.isoformat())

for i in range(48):
    components = time[i].split(':')
    components[1]="00"
    components[2] ="00"
    components = ":".join(components)
    local_time.append(components) 

#Store Data into Pandas DataFrame
data = {
    "UTC_Timestamp": AQI_times,
    "Local_Time": local_time,
    "AQI_Forecast": AQI,
    "UV_Forecast": uv_index
}

forecast_data = pd.DataFrame(data)
forecast_data<jupyter_output><empty_output><jupyter_text>Data Visualization<jupyter_code>import plotly.graph_objects as go
from plotly.subplots import make_subplots
fig = make_subplots(specs=[[{"secondary_y": True}]])
fig.add_trace(go.Bar(x=forecast_data['Local_Time'], y=forecast_data['AQI_Forecast'], name="Air Quality Forecast"), secondary_y=False)
fig.add_trace(go.Line(x=forecast_data['Local_Time'], y=forecast_data['UV_Forecast'], name="UV-Index"), secondary_y=True)
# fig.add_trace(go.line(forecast_data, x="Local_Time", y="UV_Forecast"))
print(f'Showing results for {formatted_address}')
fig.update_yaxes(title_text="Breezometer AQI (0-100)", secondary_y=False)
fig.update_yaxes(title_text="UV-Index", secondary_y=True)
fig.show()<jupyter_output>Showing results for 12042 Rives Ave, Downey, CA 90242, USA
{'fraction_non_alphanumeric': 0.1549870226177234, 'fraction_numerical': 0.014831294030404153, 'mean_word_length': 7.845901639344262, 'pattern_counts': {'":': 6, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '476526', 'license': 'MIT', 'n_tokens_mistral': 1032, 'n_tokens_neox': 980, 'n_words': 156, 'path': 'newapp.ipynb', 'repo_name': 'medinachuck/AQI-Dashboard', 'size': '2697'}