This project leverages Python, Jupyter Notebooks, and API requests to analyze weather data and recommend vacation destinations based on ideal weather conditions. The project is divided into two parts:
-
WeatherPy: Uses OpenWeatherMap API to gather weather data for over 500 randomly selected cities worldwide and analyzes relationships between weather variables and latitude.
-
VacationPy: Uses Geoapify API to find ideal vacation spots based on selected weather conditions and locates nearby hotels.
-
WeatherPy.ipynb
→ Starter file that will help pull weather data for cities around the world to help filter and collect necessary parameters for filtering in the second Jupyter Notebook file. -
VacationPy.ipynb
→ Secondary file that will help narrow down generated list of cities to meet personal parameters of humidity, cloudiness, wind speed, and max temperature. This file will also narrow down the list of prime locations to include only ones with hotels nearby.
-
City Latitude vs. Cloudiness.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
City Latitude vs. Humidity.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
City Latitude vs. Max Temperature.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
City Latitude vs. Wind Speed.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
NH Cloudiness vs. Latitude.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
NH Humidity vs. Latitude.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
NH Temperature vs. Latitude.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
NH Wind Speed vs. Latitude.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
SH Cloudiness vs. Latitude.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
SH Humidity vs. Latitude.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
SH Temperature vs. Latitude.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
SH Wind Speed vs. Latitude.png
→ Will be generated byWeatherPy
Jupyter Notebook file. -
cities.csv
→ Will be generated byWeatherPy
Jupyter Notebook file.
python-api-challenge/
│-- PyWeather/
│ │-- WeatherPy.ipynb # Weather data analysis and visualization
│ │-- VacationPy.ipynb # Vacation location selection and hotel mapping
│ │-- api_keys.py # API keys (excluded from version control)
│ │-- output_data/ # Stores generated CSV files
│ │ ├── cities.csv # Stored weather data for analyzed cities
│ │ ├── City Latitude vs. Cloudiness.png
│ │ ├── City Latitude vs. Humidity.png
│ │ ├── City Latitude vs. Max Temperature.png
│ │ ├── City Latitude vs. Wind Speed.png
│ │ ├── NH Cloudiness vs. Latitude.png
│ │ ├── NH Humidity vs. Latitude.png
│ │ ├── NH Temperature vs. Latitude.png
│ │ ├── NH Wind Speed vs. Latitude.png
│ │ ├── SH Cloudiness vs. Latitude.png
│ │ ├── SH Humidity vs. Latitude.png
│ │ ├── SH Temperature vs. Latitude.png
│ │ ├── SH Wind Speed vs. Latitude.png
│-- api_keys.py # API keys (excluded from version control)
│-- .gitignore # Prevents sensitive files from being tracked
│-- README.md # Project documentation
The goal of this project is to analyze global weather patterns and identify ideal vacation destinations based on specific climate conditions. By leveraging Python, API data retrieval, and interactive mapping, this project achieves the following objectives:
-
Collect real-time weather data for 500+ cities worldwide using the OpenWeatherMap API.
-
Analyze the correlation between latitude and key weather factors such as:
-
Temperature 🌡️
-
Humidity 💧
-
Cloudiness ☁️
-
Wind Speed 🌬️
-
-
Implement linear regression to explore trends across the Northern and Southern Hemispheres.
-
Filter locations based on ideal vacation weather conditions (e.g., moderate temperatures, low wind speeds, and clear skies).
-
Use the Geoapify API to find the nearest hotels for selected locations
-
Generate interactive maps to visualize vacation spots and hotel locations.
-
Utilize Matplotlib, SciPy, and hvPlot to create meaningful visual representations of weather trends.
-
Build interactive geographic plots using GeoViews and OpenStreetMap tiles.
By achieving these objectives, this project demonstrates how data-driven insights can be used to optimize travel planning and improve our understanding of weather patterns worldwide.
Ensure you have the following installed:
-
Python 3.8+
-
Jupyter Notebook (via Anadonda or
pip install notebook
) -
Pandas, Matplotlib, NumPy, Requests, SciPy
-
HvPlot, GeoViews, Cartopy, PyProj (via
conda
orpip
in concole)
1.) Clone the repository (or download the project files).
2.) Create a virtual environment (optional but recommended).
3.) Install dependencies if not already installed on local machine.
4.) Set up your API keys from the websites in the reference section (OpenWeatherMap API & Geoapify API).
5.) Open api_keys.pv
and fill the necessary sections with your corresponding API keys.
6.) Open WeatherPy.ipynb
in Jupyter Notebook and run each cell sequentially.
7.) Open VacationPy.ipynb
in Jupyter Notebook and run each cell sequentially.
This project relies on various external data sources and Python libraries:
-
OpenWeatherMap API → Retrieves real-time weather data for global cities.
-
Geoapify Places API → Provides geolocation data and hotel search results.
-
Pandas → For data manipulation and analysis.
-
Matplotlib → For visualizing weather trends.
-
NumPy → For numerical operations.
-
Requests → For handling API requests.
-
SciPy → For performing linear regression analysis.
-
hvPlot → For interactive plotting.
-
GeoViews → For geographic data visualization.
-
Cartopy → For map projections and spatial visualizations.
-
PyProj → For geospatial coordinate transformations.
-
Jupyter Notebook → Used as the primary development environment.
-
GitHub Guides → For managing project version control.
-
Improve data visualization using Seaborn.
-
Add historical weather analysis.
-
Implement a vacation itinerary generator.