This project focuses on collecting, analyzing, and visualizing real-time weather data from the OpenWeatherMap API using Python.
It provides live updates of temperature, humidity, pressure, and other weather parameters for multiple cities, performs trend analysis using Pandas, and visualizes results through Matplotlib and Seaborn.
- ๐ Integrated OpenWeatherMap API to fetch real-time weather and forecast data.
- ๐งฎ Processed and analyzed data using Pandas for temperature, humidity, and pressure insights.
- ๐ Automated hourly data updates using Pythonโs
schedulemodule. - ๐ Created visualizations with Matplotlib and Seaborn for trends and correlations.
- ๐พ Exported analyzed data into Excel/CSV files for reporting and record-keeping.
- ๐ Performed analytical insights such as:
- Hottest & Coldest Cities
- Correlation between Temperature, Humidity, and Pressure
- Weather Condition Frequency Distribution
- Forecast Trends for the Next 5 Days
| Layer | Tools / Technologies |
|---|---|
| Programming Language | Python |
| API Source | OpenWeatherMap API |
| Libraries | Pandas, Requests, Matplotlib, Seaborn, Schedule, OpenPyXL |
| Data Format | Excel / CSV |
๐ Workflow
- API Data Collection
Fetched temperature, humidity, visibility, windspeed
Handled API token & errors
- Data Cleaning
Converted units
Removed invalid records
Filled missing info
- Analysis
Temp trends
Humidity variation
Weather condition classification
- Dashboard
Multi-city comparison
Forecast charts
Parameter correlations
โ Run the Script python weather_api_fetch.py
๐งพ Key Insights
Coastal areas have 10โ15% higher humidity
Fetch Real-Time Weather Data
params = {"q": city, "appid": API_KEY, "units": "metric"}
response = requests.get(BASE_URL, params=params)
data = response.json()
record = {
"City": city,
"Temperature (ยฐC)": data["main"]["temp"],
"Humidity (%)": data["main"]["humidity"],
"Pressure (hPa)": data["main"]["pressure"],
"Wind Speed (m/s)": data["wind"]["speed"],
"Weather": data["weather"][0]["main"],
"Time": datetime.now().strftime("%Y-%m-%d %H:%M:%S")
}
---
