Questions tagged [google-python-api]

The Google API Client Library for Python is designed for Python client-application developers. It offers simple, flexible access to many Google APIs. https://developers.google.com/api-client-library/python/

please use [Google-api-python-client] tag

91 questions
15
votes
1 answer

What is the difference between google.cloud.pubsub_v1 and google.cloud.pubsub?

I see both used in different documentation from Google: from google.cloud import pubsub Is found…
gunit
  • 3,700
  • 4
  • 31
  • 42
8
votes
2 answers

How to merge cells with Google Sheets API?

I am using the Python client for the Google Sheets API to build a spreadsheet. I am able to create a new sheet and update values in it, but I have been unable to merge cells for the header row that I want. top_header_format = [ {'mergeCells': { …
ctp_9
  • 338
  • 2
  • 10
6
votes
1 answer

Submitting Google Cloud ML Engine Jobs from Python Directly

I have a Keras .h5 model which I've been training locally, however now wish to automate the full process via the Google Cloud ML-Engine. I have all the GCloud Storage buckets set up to be accessed from the application, and I have read about…
5
votes
1 answer

Does gcloud storage python client API support parallel composite upload?

The gsutil command has options to optimize upload/download speed for large files. For example GSUtil:parallel_composite_upload_threshold=150M GSUtil:sliced_object_download_max_components=8 see this page for reference. What is the equivalence in the…
nos
  • 19,875
  • 27
  • 98
  • 134
4
votes
2 answers

create new folder in google drive with rest api

How can I create a new folder in google drive using python only if it doesn't exists? I am completely new to this google APIs and python. (I have an access token for my account and I want to create folder using that.) create folder import…
kkr
  • 115
  • 1
  • 14
4
votes
1 answer

GCP enable services/apis via Rest API or python module

How can I enable/disable APIs/Services in Google Cloud Project via Restful APIs or python? For example, I want to enable following API/Service in a project. https://console.developers.google.com/apis/api/iam.googleapis.com/overview?project=
A_K
  • 81
  • 8
4
votes
1 answer

Trying to Access Google Directory API via p12 throws not authorized error

from apiclient.discovery import build from oauth2client.service_account import ServiceAccountCredentials import json import base64 import httplib2 f = file('tara1-553d334b8702.p12', 'rb') key = f.read() f.close() credentials =…
4
votes
1 answer

Google python api how to define the service instance

In the Google API for python to send an email, https://developers.google.com/gmail/api/guides/sending you can find this method def send_message(service, user_id, message): try: message = (service.users().messages().send(userId=user_id,…
Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253
3
votes
2 answers

How to get delegated credentials objects for invoking google apis?

I am trying to fetch gsuite alerts via API. I have created a service account as per their docs and I have assigned that service account to my google cloud function. I do not want to use environment variables or upload credentials along with source…
3
votes
4 answers

Read huge JSON line by line from Google Cloud Storage with Python

I know I should have a code but I have nothing useful yet. There is ~300GB JSON file on my GCS gs://path/listings_all.json ultimately I'm trying to import it into BigQuery but it has some wrong data structure (I have sourced it by mongoexport from…
3
votes
1 answer

404 Error when requesting comments via Google Blogger API

I have a script to help manage a Google Blogger site and it's been running for little more than a year without any issues. A couple of weeks ago, the script stopped working properly, instead returning "404 Not Found" errors when requesting a list…
3
votes
1 answer

load large data from bigquery to python

from google.cloud import bigquery as bq import google_auth_oauthlib.flow query = '''select ... from ...''' bigquery_client = bq.Client() table = bq.query.QueryResults(query=query,client=bigquery_client) table.use_legacy_sql = False table.run() #…
3
votes
1 answer

How to use google cloud speech api in python

I am exploring google cloud speech api in python.I am following this link. I also referred this stackoverflow link.But I got struck from setting the environment variables. Things I have done: 1.Installed gcloud python module 2.Installed…
2
votes
1 answer

Passing Google access token from client to server

I have an application integrated with Google services (Google Bigquery API to be specific.) I am authenticating the user on the client side, without offline access scopes (hence without refresh tokens), and doing most of the operations on the client…
Ozgur Akcali
  • 5,264
  • 2
  • 31
  • 49
2
votes
1 answer

Google Earth Engine Python API: Map function over image collection with a list of bands

I have been using the code by Sam Murphy for atmospheric correction of Sentinel-2 images in Google Earth Engine. All goes well and it runs very fast for a single image. What I would like to do is map the following code over an image…
1
2 3 4 5 6 7