Now that we know how to write functions, let's apply that knowledge to a practical task. In this chapter, we will build a function that will communicate with a web service via a REST API in order to get the latitude and longitude of a given address. Furthermore, we'll discuss how to use built-in Python libraries to read and write data from and to files. Finally, we will wrap this functionality into a standalone script, so that it can be used from the command line, with no Jupyter Notebook attached.
In this chapter, we will learn how to do the following:
- Work generally with Python's built-in libraries and requests in particular
- Communicate with web services via APIs
- Read and write data using the CSV file format
- Wrap code into a standalone script with the command-line interface, using the built-in sys.argv library, and...