Question
Assignment #6 NES 470, Fall 2022, Dr. Ahmad T. Al-Hammouri Due date: Friday 13/1/2023 at 11:55pm. Objectives: To use Python to interact with Web service
Assignment #6 NES 470, Fall 2022, Dr. Ahmad T. Al-Hammouri Due date: Friday 13/1/2023 at 11:55pm. Objectives: To use Python to interact with Web service REST APIs. Problem Statement: Develop a Python script that queries the OpenWeather APIs (https://openweathermap. org/) to retrieve certain weather data. As a first and required step, sign up for a free-tier account with the service to obtain an API access key via the URL: https://home.openweathermap.org/users/sign_up. The Web service APIs are documented here: https://openweathermap.org/current. (You may want to proceed to Built-in API request by city name section.) The program requirements are as follows: The script accepts two command line arguments: The API key, e.g., 9e070ac56dbf6712ab07c78bdfc106r7. The city name, e.g., Osaka. For example, the script must be run as follows ./ID-xxxxxx.py 9e070ac56dbf6712ab07c78bdfc106r7 Osaka where xxxxxx is your student ID. The script will be executed on a Linux machine. The script sends the appropriate request to the OpenWeather Web service to obtain the weather data for the entered city name. The script displays on the standard output the city name, the country, the longitude and latitude coordinates, the weather condition, and the temperature in Celsius. The output must be in the following format City Name: Osaka Country: JP Longitude, Latitude: 135.5022, 34.6937 Weather: Mist Temperature: 4.54 C If the city name cannot be found, the script displays an appropriate error messge on the standard output, e.g., The city name Osakaa is not found! The script uses the Requests package. You are allowed to use ONLY the Python Standard Library, but not any other libraries developed by any third party, except the Request package. Grading Policy:NES 470, Fall 2022 Assignment #6 Page 2 of 2 You must turn in only working code. If your code gives run-time errors, you will receive zero credit. Partial credit is given only for working code that does not implement all the require- ments above. Deliverables: Name the script file as follows ID-xxxxxx.py, where xxxxxx is your student ID. Submit ONLY the Python script file to the elearning via the provided link. Do NOT send it via e-mail or a message from within the elearning even before the deadline because it will be deleted tacitly. ONLY one student from each group must submit the file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started