DEV Community

Cover image for WEATHER DASHBOARD
Oluwaseun Olaleye
Oluwaseun Olaleye

Posted on

WEATHER DASHBOARD

USE CASE
My manager tasked me with creating a weather dashboard and storing it in an s3 bucket using weather API and python.

PREREQUISITES

  • Linux commands

  • Ubuntu server

  • AWS free tier account.

  • AWS CLI

Let's dive into it.

Firstly, I commenced by cloning a GitHub repository from https://github.com/ShaeInTheCloud/30days-weather-dashboard. This step enabled me to obtain a local copy of the repository's codebase.
Image description

Next. I installed all dependencies including Python. Then, I activated a virtual environment to isolate the project dependencies. With the virtual environment activated, i proceeded to install pip, Python package installer to facilitate the installation of additional project dependencies.

Image description

Image description

Image description

Image description

AWS Command Line Interface
Next, I installed the AWS CLI on my ubuntu server https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html. Additionally, I created a new IAM user and generated access keys for that user. I then utilized those credentials to configure the AWS CLI.

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Next, I used the Weather API to retrieve current weather conditions and forecasts. After retrieving the weather data, I processed it into a JSON format and stored it in a python dictionary. I then used the boto3 library to upload the data to an S3 bucket.

Image description

Image description

Image description

After executing the code, I verified the creation of the S3 bucket and confirmed that it had been successfully established.

Image description

Image description

CONCLUSION
I successfully created a weather dashboard utilizing python and the Weather API , and subsequently stored the weather forecast data to amazon S3 bucket.

Top comments (1)

Collapse
 
doushabao profile image
Doushabao

Great article about weather APIs! I've found that combining multiple sources gives better coverage. Have you tried aggregating them?