Questions tagged [google-api-python-client]

The Google APIs Client Library for Python provides access to for Google's discovery based APIs. It is designed for Python client-application developers and offers simple, flexible, powerful API access.

This is the Python client library for Google's discovery based APIs. To get started, please see the full documentation for this library. Additionally, dynamically generated documentation is available for all of the APIs supported by this library.

Python Version

Python 2.7, 3.4, 3.5, and 3.6 are fully supported and tested. This library may work on later versions of 3, but we do not currently run tests against those versions.

Third Party Libraries and Dependencies

The following libraries will be installed when you install the client library:

  • httplib2
  • uritemplate

For development you will also need the following libraries:

  • WebTest
  • pycrypto
  • pyopenssl

Links

1538 questions
178
votes
20 answers

Why is my Python App Engine app using the Translate API getting an error of ImportError: No module named apiclient.discovery?

I got this error in Google App Engine's Python have used Google Translate API, But I don't know how to fix, from apiclient.discovery import build ImportError: No module named apiclient.discovery I'll try to set environment which indicates…
74
votes
8 answers

How do I access (read, write) Google Sheets spreadsheets with Python?

I am wondering if you can point me to an example of reading/writing to/from a google doc/spreadsheet using python. I did look at google docs API here https://developers.google.com/google-apps/spreadsheets/ but not sure if I hit the right link. Also…
54
votes
3 answers

ValueError: Client secrets must be for a web or installed app

I am running the quickstart.py example code under Python Quickstart and I am getting the following error: ValueError: Client secrets must be for a web or installed app. I created a credentials.json file with project owner rights. The error occurs…
PaoloAgVa
  • 1,302
  • 1
  • 10
  • 21
38
votes
4 answers

How can I get a list of sheets (name and "gid") in a Google spreadsheet using the Drive API?

I am trying to use Google Drive API (Python) to download some tabs of a spreadsheet file. Is the gids information in the file's metadata? What I am trying to do is (this may not be correct, please suggest) : file_metadata =…
32
votes
15 answers

How to get list of folders in a given bucket using Google Cloud API

I wanted to get all the folders inside a given Google Cloud bucket or folder using Google Cloud Storage API. For example if gs://abc/xyz contains three folders gs://abc/xyz/x1, gs://abc/xyz/x2 and gs://abc/xyz/x3. The API should return all three…
Shamshad Alam
  • 1,684
  • 3
  • 19
  • 31
30
votes
8 answers

How do I rename a (work)sheet in a Google Sheets spreadsheet using the API in Python?

I have been trying/looking to solve this problem for a long while. I have read the documentation for gspread and I cannot find that there is a way to rename a worksheet. Any of you know how to? I would massively appreciate it! There is indeed…
25
votes
3 answers

Is there a way to pre-check or avoid the scopes checkbox in Google's Gmail / Google Calendar OAuth approval flow?

We currently use google-api-python-client to handle our user-facing OAuth flow. We had a few users email us asking why their accounts didn't import successfully, and when we looked, their tokens didn't have the appropriate scopes. For example, we…
25
votes
5 answers

Unable to access BigQuery from local App Engine development server

This is specifically a question relating to server to server authorisation between a python Google AppEngine app and Google's BigQuery, but could be relevant for other cloud services. tldr; Is it possible to get the App Engine local development…
24
votes
3 answers

How to get Google Analytics credentials without gflags - using run_flow() instead?

This may take a second to explain so please bear with me: I'm working on a project for work that requires me to pull in google analytics data. I originally did this following this link, so after installing the API client pip install --upgrade…
20
votes
7 answers

Google & Oauthlib - Scope has changed

I am using OAuthlib for conducting OAuth flow of Google. It was working well for 4 to 5 months. Suddenly I started getting below error: File…
18
votes
4 answers

Google Calendar API v3 - How to obtain a refresh token (Python)

I am trying to write a Django app which creates events in a specific Google calendar. So far I have been successful. There is only a little problem: I don't know how to obtain a refresh token with the google python client. The result is that after…
Jens
  • 20,533
  • 11
  • 60
  • 86
18
votes
3 answers

How do I use google.oauth2 python library?

I'm trying to just make a simple rest call to a secure predict endpoint for a google machine learning project but it can't find the google.oauth2 module. This is my code: import urllib2 from google.oauth2 import service_account #…
Alex Egli
  • 1,884
  • 2
  • 24
  • 43
17
votes
3 answers

Invalid and/or missing SSL certificate for URL when calling apiclient.discovery.build

So I'm running my google endpoint locally with dev_appserver.py. I use the API explorer to test the application. The code I'm using to create the Service, so I can call the API is the following: from apiclient.discovery import build from…
diogovk
  • 2,108
  • 2
  • 19
  • 24
16
votes
2 answers

How to upload file to google drive with service account credential

I wanted to upload the files to my Google Drive using a Google service account credentials. I downloaded credential as a JSON file from Google Developer Console, and got credential from it. Here is my code snippet. google_drive_service =…
16
votes
1 answer

Google Oauth2.0 web application's "Authorized redirect URIs" must end with a public top-level domain (such as .com or .org)?

When create a Google API Oauth2.0 Credentials on Google Developers Console, I choose "Web Application" Application type. In the "Authorized redirect URIs" field, I can use http://127.0.0.1/callback, it work fine for me on local development. but when…
GoTop
  • 850
  • 1
  • 9
  • 22
1
2 3
99 100