Building a Weather Dashboard using S3, Python and OpenWeather API

Overview

This Project is a Python-based application designed to interact with the OpenWeather API to fetch and display real-time weather data. This project demonstrates how to consume a third-party API, handle HTTP requests, process JSON res…


This content originally appeared on DEV Community and was authored by Ameh Mathias Ejeh

Overview

This Project is a Python-based application designed to interact with the OpenWeather API to fetch and display real-time weather data. This project demonstrates how to consume a third-party API, handle HTTP requests, process JSON responses, and present weather data in a user-friendly manner.

Features

  • Retrieve current weather data for a specified location.
  • Display weather details such as temperature, humidity, wind speed, and weather conditions.
  • Automatically stores weather data in AWS S3
  • Supports multiple cities tracking
  • Timestamps all data for historical tracking
  • Handle errors gracefully, including invalid API keys, network issues, and unsupported locations.

Prerequisites

Before running this project, ensure the following requirements are met:

  • AWS Account
  • Python 3.8.10 installed on your system.
  • An active OpenWeather API key.
  • Required Python packages installed.

Project Structure

Open-Weather-API-Project/
├── src/
├── init.py # Package initializer
├── weather_dashboard.py # Main script to run the application
├── .gitignore # Git ignore file
├── README.md # Project documentation
├── requirements.txt # Python dependencies

Architecture Diagram

Image description

Setup Instructions

  • clone the repository:
git clone https://github.com/ameh0429/Open-Weather-API-Project.git
 cd Open-Weather-API-Project
  • Install Dependencies
pip install -r requirements.txt

Image description
The error indicates a dependency conflict between the version of request I specified (2.28.2) and the version required by jupyterlab-server (>=2.31)

Step to fix

since jupyterlab-server requires requests>=2.31, I upgraded requests to a version that satisfies this requirement by runnig this command:

pip install "requests>=2.31"

Image description

  • Configure environment variables (.env)
OPENWEATHER_API_KEY=your_api_key
AWS_BUCKET_NAME=your_bucket_name
  • Configure AWS credentials:
aws configure

Image description

  • Insert the python script in the weather_dashboard.py file

Image description
This Python script is building a class named WeatherDashboard to:

  1. Fetch environment variables using dotenv for API keys and S3 bucket names.
  2. Use boto3 (AWS SDK for Python) to interact with AWS S3.
  3. Set up functionality to fetch weather data, process it, and store it in an S3 bucket
  • Run the application:
python src/weather_dashboard.py

Image description

  • Confirm the weather data in S3 bucket

Image description

  • Future Improvements
  1. Add support for extended forecasts (e.g., 7-day weather data).
  2. Implement unit tests for better code coverage.
  3. Enable geolocation-based weather fetching.


This content originally appeared on DEV Community and was authored by Ameh Mathias Ejeh


Print Share Comment Cite Upload Translate Updates
APA

Ameh Mathias Ejeh | Sciencx (2025-01-17T23:09:50+00:00) Building a Weather Dashboard using S3, Python and OpenWeather API. Retrieved from https://www.scien.cx/2025/01/17/building-a-weather-dashboard-using-s3-python-and-openweather-api/

MLA
" » Building a Weather Dashboard using S3, Python and OpenWeather API." Ameh Mathias Ejeh | Sciencx - Friday January 17, 2025, https://www.scien.cx/2025/01/17/building-a-weather-dashboard-using-s3-python-and-openweather-api/
HARVARD
Ameh Mathias Ejeh | Sciencx Friday January 17, 2025 » Building a Weather Dashboard using S3, Python and OpenWeather API., viewed ,<https://www.scien.cx/2025/01/17/building-a-weather-dashboard-using-s3-python-and-openweather-api/>
VANCOUVER
Ameh Mathias Ejeh | Sciencx - » Building a Weather Dashboard using S3, Python and OpenWeather API. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/01/17/building-a-weather-dashboard-using-s3-python-and-openweather-api/
CHICAGO
" » Building a Weather Dashboard using S3, Python and OpenWeather API." Ameh Mathias Ejeh | Sciencx - Accessed . https://www.scien.cx/2025/01/17/building-a-weather-dashboard-using-s3-python-and-openweather-api/
IEEE
" » Building a Weather Dashboard using S3, Python and OpenWeather API." Ameh Mathias Ejeh | Sciencx [Online]. Available: https://www.scien.cx/2025/01/17/building-a-weather-dashboard-using-s3-python-and-openweather-api/. [Accessed: ]
rf:citation
» Building a Weather Dashboard using S3, Python and OpenWeather API | Ameh Mathias Ejeh | Sciencx | https://www.scien.cx/2025/01/17/building-a-weather-dashboard-using-s3-python-and-openweather-api/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.