Question
Consuming A Web Service with Python Consuming data from programmable web based API's is growing rapidly. According to ProgrammableWeb, in just six years (2010-2016), web
Consuming A Web Service with Python
Consuming data from programmable web based API's is growing rapidly. According to ProgrammableWeb, in just six years (2010-2016), web API counts increased 758 percent with the majority being REST based. This is driven by a myriad of factors but growth of cloud based applications, (distributed computing by another name), and the resulting need to integrate the different categories is a major factor.
Description
Compose a client to consume a REST web service of you choice using Python. There are many listings of such services but an excellent resource is ProgrammableWeb (https://www.programmableweb.com/). Your information should produce useful information. I.e. a dump of cryptic data is not the desired product. Examples could be a weather forecast, stock quote, Bible verse, etc.,
Your solution should present the user with a question with the answer contributing to the data used in the REST web service call. For example, a weather forecast would prompt the user to enter a zip code or other location information. Once the web transaction is complete, the program should prompt again with the same question to finish another transaction. This should continue until the user enters a specified termination condition.
You output must be presented in an understandable manner. Dumps of XML, JSON, etc., are substandard and will be graded accordingly.
Hint:
Another site with a simple REST API can be found here: http://labs.bible.org/api_web_service Be sure to click on the examples and look at the address bar of your browser. That is what you will need to generate with the Python requests module.
You are free to use any REST web service you find but I recommend this one if you are looking for something straightforward. One word of caution, some services require you to request access via an API key. The approval may not be immediate so you will want to find something sooner rather than later. The example I listed above requires no approval.
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