Google Translate with Python

How to connect to the Google Translate API directly with Python

Zachary Warnes
CodeX

--

Photo by Brett Jordan on Unsplash

Here is a brief introduction to using the Google Translate API in python. The Google Translate API is easy to access in python with the help of the package googletrans.

This library is easy to use and allows a user to translate python strings from any source language to any target language currently available from Google Translate.

While Google translate won’t be a perfect replacement for a professional translator or a native speaker, it can suffice in many situations.

Consider using this package when you need to translate text in your python projects programmatically.

Language Background

Over the last two years, I studied abroad in the Netherlands. Even though the Dutch fully embrace English bilingualism, most government documents are in Dutch. So while my Dutch is quite bad even to this day, I was able to get the gist of most documents simply from Google Translate.

Moreover, I found that in most cases, the discrepancies were manageable. Given the context of the document, something like a phone plan in Dutch translated to English becomes feasible to understand in broken English.

Google translate

--

--

Zachary Warnes
CodeX
Writer for

Data Scientist | Writer | Creator | YouTube — AI for Life | — Interested in understanding and solving problems in innovative ways zjwarnes.medium.com/membership