If you want to translate arbitrary (natural) text, check out Goslate, a free python API to Google Translation Services. According to this website, code is as easy as this:
import goslate
gs = goslate.Goslate()
print(gs.translate('hello world', 'de'))
You can pip install using
pip install goslate