def export_table(bigquery, cloud_storage_path, project_id, dataset_id, table_id, export_format='CSV', num_retries=5, compression='NONE'):
 job_data = {'jobReference': {'projectId': project_id, 'jobId': str(uuid.uuid4())}, 'configuration': {'extract': {'sourceTable': {'projectId': project_id, 'datasetId': dataset_id, 'tableId': table_id}, 'destinationUris': [cloud_storage_path], 'destinationFormat': export_format, 'compression': compression}}}
 return bigquery.jobs().insert(projectId=project_id, body=job_data).execute(num_retries=num_retries)

def export_table ( bigquery , cloud_storage_path , project_id , dataset_id , table_id , export_format = 'CSV' , num_retries = 5 , compression = 'NONE' ) : job_data = { 'jobReference' : { 'projectId' : project_id , 'jobId' : str ( uuid . uuid4 ( ) ) } , 'configuration' : { 'extract' : { 'sourceTable' : { 'projectId' : project_id , 'datasetId' : dataset_id , 'tableId' : table_id } , 'destinationUris' : [ cloud_storage_path ] , 'destinationFormat' : export_format , 'compression' : compression } } } return bigquery . jobs ( ) . insert ( projectId = project_id , body = job_data ) . execute ( num_retries = num_retries )
starts an export job args: bigquery: initialized and authorized bigquery google-api-client object .