This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def import_to_big_query(data, context, dataset='UPDATE_DATASET_HERE', table='UPDATE_TABLE_HERE', verbose=True): | |
def vprint(s): | |
if verbose: | |
print(s) | |
vprint('Event ID: {}'.format(context.event_id)) | |
vprint('Event type: {}'.format(context.event_type)) | |
vprint('Importing required modules.') | |
from google.cloud import bigquery |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import time | |
import argparse | |
from google.cloud import translate | |
#####progress bar start ##### | |
def format_interval(t): | |
mins, s = divmod(int(t), 60) | |
h, m = divmod(mins, 60) |