Used Pandas, Flask and Docker to create a tool to process tide gauge data in .csv format into a cloud compatible form.
The tideReadings.csv file contains sea level readings (in m) recorded over 15 minute windows at tide gauges around the UK for the week of Monday 20th September 2021. The columns are:
dateTime: The date and time for which the reading is valid.stationName: The human readable tide gauge name.tideValue: the tide gauge reading in metres (relative to mean sea level at Newlyn).
The stations.csv file contains some relevant information on the tide gauge stations. The columns are:
stationName: The human readable tide gauge name.stationReferenceThe Environment Agency short code for the stationstationURLthe Environment Agency REST API URL for the station, which can be called to access more information if needed.
- Wrote appropriate Python code to complete the methods of class
Readerinprocess.py. See the docstrings in each method for details of key functionality required, although other methods or functions can be added if appropriate. This - Wrote Python code in
app.pyto serve a REST API for the data in the two.csvfiles. See theAPI.rstfile for a description of required paths and responses. You may either use Flask, or builtin Python modules, and may add additional classes or functions as needed, to theprocess.pyandapp.pyfiles, or to new Python files. - Updated the
Dockerfileto correctly serve yourapp.pyon the container's port 80, so that the command sequence
docker build --tag tides:latest
docker run -it -p8888:80 tides:latestallows a user to connect to http://localhost:8888/station/json?stationName=Newlyn and see a response listing the tide data for the Newlyn station.