Replace "requests" with Google Client Library
Instead of using the requests
library, we could use Google's own Google Cloud Library for Python to interface with Google's cloud translation. This could help us avoid boilerplate, simplify exception handling, make use of abstractions and use Python native conventions. There are many libraries for the various cloud services but the one that we need is the Python Client for Cloud Translation API.
This might be unnecessary considering the small amount of code we already have to communicate with Google Cloud Translation but I wanted to share my findings just in case.