Skip to content

Instantly share code, notes, and snippets.

Avatar

DiMiTriFrog DiMiTriFrog

View GitHub Profile
@DiMiTriFrog
DiMiTriFrog / GoogleTranslate.py
Created Apr 10, 2020
GoogleTranslate.py -> Sample object to translate text or html with Google Cloud using Python | Stratton Apps SL
View GoogleTranslate.py
# Author: Stratton Apps SL | andorrainsiders.com & strattonapps.com
from google.cloud import translate
import os
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'credentials.json'
proj_id = 'translate-33434'
class Session(object):
def __init__(self):
self.client = translate.TranslationServiceClient()