Develop a REST server script named measurement_server.py. This script will respond to requests for data from the
Question:
Develop a REST server script named measurement_server.py. This script will respond to requests for data from the measurement database by sending back data that is JSON serialized. The server should listen on any interface at a particular port number.
Here are the paths and the requests that they correspond to
Path------------------------------------------------------------------- Function
/area----------------------------------------------------------Get a list of all areas
/area/(\d+)/location----------------------------------------Get all locations for the given area id
/location/(\d+)/measurement----------------------------Get all the measurements for the given location id
/area/(\d+)/category---------------------------------------Get all the categories to which the given area belongs
/area/(\d+)/average_measurement--------------------Get the average measurement for the given area
/area/(\d+)/number_locations---------------------------Get the number of locations in the given area
Notes :
• In the first four request types, return a list of dictionaries, JSON encoded
• In the last two request types, return the numbers. JSON encoded
You may wish to follow the organization used in the sakila_rest example in class.
Overview
This assignment will use the measurements example database as a subject. You will be providing data from this database as a service using REST. The measurements example is described in the Measurements Example.pdf. But, please note! Use the file measures.sqlite rather than recreate the file yourself.
Test Setup
The project “assign05_test.zip” contains a short test. The file test2.py is the test script, the other files are support. Note: the testing files should not be in the same directory with the server. Link to all the file required: http://ksuweb.kennesaw.edu/~bsetzer/4720su16/nanoc/output/assignments/5/
Statistics The Art and Science of Learning from Data
ISBN: 978-0321755940
3rd edition
Authors: Alan Agresti, Christine A. Franklin