Project Overview
In this project, we are using some small data sets from the data journalism website FiveThirtyEight. The RESTful APIs that we are creating all assume that we are the maintainers of this data set and are providing an API to customers who need this data on a regular basis.
Teams
You will find your teams in gitlab, and project assignments in myCourses
Language Choice
The technology stack for this project will be:
- Python 3.7
- Flask web framework
- Flask-RESTful library
- Requests library for HTTP testing
- PostgreSQL 11 database
- psycopg2 for PostgreSQL interaction
- You need to make sure this runs on the GitLab CI. The instructor and TA are well-versed in Docker and can help you on this, but ultimately this is on your team.
- You must use HTTP-based automated tests on the CI. Our default setup instructions use Python and the Requests library. If you use other libraries with Python, that is ok, but you are responsible for making sure everything works in the environment
Setup
Follow our RESTful setup instructions.
Tips and Tools
- Python’s
unittest
library is built-in, but there are other compatible libraries that do more. One other ispytest
as an alternative. Your tests are exactly the same, just install it and runpytest
instead ofpython -m unittest
. A particularly helpful option ispytest --pdb
which invokes a debugger on failed unit test. - Speaking of debuggers, the
breakpoint()
method is available in Python everywhere. Just run it near your broken code and when Python encounters it, your code will drop into a debugging console. - The output of our RESTful APIs will be in JSON. You can install a browser extension that will automatically format JSON for you so that you can see and traverse the output easier.