Implementing a REST API using Python
If you are familiar with Python programming, then you might find yourself wondering whether you can write your APIs using Python instead of JavaScript. The answer is in the affirmative, and we are going to do just that.
We will make use of Python 3 and FastAPI to create the REST API that we need. FastAPI is a Python framework for building APIs. Python can be downloaded at https://www.python.org/downloads/.
Follow these steps to confirm that you have Python installed:
- The first thing that you need to do is confirm that you have a version of Python installed that is at least 3.7. You can do that by running the following command from your CLI:
python -V
You should get an output similar to the following if you have Python installed:
Figure 5.18 – The result of checking the Python version
- If you don’t have Python installed, please visit the Python downloads page to get the right version...