Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Python script to display a result like below for a certain zip code. The site OpenWeatherMap has a REST API to get the

Create a Python script to display a result like below for a certain zip code. The site OpenWeatherMap has a REST API to get the weather data. Use zip code 30055.

Name: KSU

Current Temperature: 64.5 degrees Fahrenheit

Atmospheric Pressure: 992.52 hPa

Wind Speed 10.6 mph

Wind Direction 289.5

Time of Report 2017-03-10 11:13:24

OpenWeatherMap will require a free account, provided below. You do not have to use this account, however, if you'd rather create one.

ID: Billybob

Pass: 123weather

The "current weather data API" page tells you how to create a request for the current weather at a particular zip code. Information on the page tells the structure of the data returned. The "How to start" page tells how to include the APIID and id in a request. Please use imperial units for the request.

The data you get back will be encoded as JSON. You will need to decode it to access the information contained in the response.

Use the datetime class in the datetime package from the standard library to convert the time stamp included in the data to readable form. The value included in the data is the number of seconds since the epoch (standard Unix timestamp). The displayed value above is the default display of a datetime object created from the raw timestamp.

At the beginning of your script assign values to variables user_id and user_apiid. These will be strings with the values of your id and apiid. Do not include your id or your apiid values directly in your code, use the variables instead

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions