google-api-python-client | official Python client library for Google 's discovery | REST library

 by   googleapis Python Version: 2.119.0 License: Apache-2.0

kandi X-RAY | google-api-python-client Summary

kandi X-RAY | google-api-python-client Summary

google-api-python-client is a Python library typically used in Web Services, REST, Bitcoin applications. google-api-python-client has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can install using 'pip install google-api-python-client' or download it from GitHub, PyPI.

The official Python client library for Google's discovery based APIs.

            kandi-support Support

              google-api-python-client has a highly active ecosystem.
              It has 6658 star(s) with 2351 fork(s). There are 280 watchers for this library.
              There were 10 major release(s) in the last 6 months.
              There are 90 open issues and 896 have been closed. On average issues are closed in 81 days. There are 10 open pull requests and 0 closed requests.
              It has a negative sentiment in the developer community.
              The latest version of google-api-python-client is 2.119.0

            kandi-Quality Quality

              google-api-python-client has 0 bugs and 0 code smells.

            kandi-Security Security

              google-api-python-client has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              google-api-python-client code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              google-api-python-client is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              google-api-python-client releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              It has 1666968 lines of code, 698 functions and 3969 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed google-api-python-client and discovered the below as its top functions. This is intended to give you an instant insight into google-api-python-client implemented functionality, and help decide if they suit your requirements.
            • Builds a API client
            • Add a query parameter to a URL
            • Returns a list of valid discovery urls
            • Retrieve the discovery document
            • Generates a hierarchy of accounts
            • Prints accounts response
            • Prints pagination information
            • Create a new instance
            • Read n items from the stream
            • Perform a GET request
            • Extract the reason from the response body
            • Print the results
            • Get the top keywords for a given profile
            • Create a Notification from the given headers
            • Print a table
            • Return the best match for supported media types
            • Create an authorized HTTP client
            • Generate a context for a sample
            • Generate the PEP body of the change report
            • Uploads a shapefile
            • Generate all API docs
            • Scans a directory of README files
            • Return a DataFrame containing the discovery changes
            • Get the first profile id associated to the account
            • Update the settings for a group
            • Set the parameters from a method description
            Get all kandi verified functions for this library.

            google-api-python-client Key Features

            No Key Features are available at this moment for google-api-python-client.

            google-api-python-client Examples and Code Snippets

            google-api-python-client - management v3 reference
            Pythondot img1Lines of Code : 239dot img1License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            # -*- coding: utf-8 -*-
            # Copyright 2014 Google Inc. All Rights Reserved.
            # Licensed under the Apache License, Version 2.0 (the "License");
            # you may not use this file except in compliance with the License.
            # You may obtain a co  
            google-api-python-client - core reporting v3 reference
            Pythondot img2Lines of Code : 128dot img2License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            # -*- coding: utf-8 -*-
            # Copyright 2014 Google Inc. All Rights Reserved.
            # Licensed under the Apache License, Version 2.0 (the "License");
            # you may not use this file except in compliance with the License.
            # You may obtain a co  
            google-api-python-client - search analytics api sample
            Pythondot img3Lines of Code : 116dot img3License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            # -*- coding: utf-8 -*-
            # Copyright 2015 Google Inc. All Rights Reserved.
            # Licensed under the Apache License, Version 2.0 (the "License");
            # you may not use this file except in compliance with the License.
            # You may obtain a co  
            Google People API as a Worker/CLI
            Pythondot img4Lines of Code : 2dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            service = build('people', 'v1', developerKey='YOUR_API_KEY_HERE')
            How do I get the ID of a document by knowing the file name?
            Pythondot img5Lines of Code : 4dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            response = drive_service.files().list(q="name='filename'",
                                                  fields='files(id, name)'
            Google Drive Authenticate and Download Files with Service Account
            Pythondot img6Lines of Code : 51dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            from apiclient.discovery import build
            from oauth2client.service_account import ServiceAccountCredentials
            SCOPES = ['']
            KEY_FILE_LOCATION = ''
            def initialize_drive():
              """Initializes an drive servic
            Getting KeyError: 'viewCount' for using Youtube API in Python
            Pythondot img7Lines of Code : 2dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            Views = video['statistics'].get('viewCount')
            How can I use Google's spreadsheet API to retrieve the date and time a spreadsheet is created?
            Pythondot img8Lines of Code : 4dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            Google Drive API v3 changing metadata of file
            Pythondot img9Lines of Code : 8dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            file = service.files().get(fileId=file_id).execute()
            file_metadata = {'starred': true}
            updated_file = service.files().update(
                        body=file_metadata ).execute(
            authorize() missing 1 required positional argument: 'http' when running Google Cloud SDK example
            Pythondot img10Lines of Code : 18dot img10License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            class OAuth2Credentials:
                def authorize(self, http):
            import httplib2
            from googleapiclient import discovery
            from oauth2client.client import OAuth2Credentials
            creds = OAuth2Credentials(...) #

            Community Discussions


            Google People API as a Worker/CLI
            Asked 2022-Apr-15 at 13:29

            I'm trying to use Google People API as a python worker (with celery) so this is not a webapp (I'm using the python libraries suggested in their documentation (google-api-python-client, google-auth-httplib2 and google-auth-oauthlib).

            So I'd like to use the API keys to access to the API and I can not find any documentation about using in this way and what limitations will have or anything.

            I didn't find anyone asking this question before.



            Answered 2022-Apr-15 at 13:29

            Depends on how you're calling the APIs. I advise to use the library for Google APIs.

            It seems that the People API is not listed in the APIs available through the Google Cloud APIs here.
            NOTE: you should use that library if the API in question is available there.

            The google-api-python-client has a description on how to use API keys here, but to put it simply, build the service object using the key.



            The airflow scheduler stops working after updating pypi packages on google cloud composer 2.0.1
            Asked 2022-Mar-27 at 07:04

            I am trying to migrate from google cloud composer composer-1.16.4-airflow-1.10.15 to composer-2.0.1-airflow-2.1.4, However we are getting some difficulties with the libraries as each time I upload the libs, the scheduler fails to work.

            here is my requirements.txt



            Answered 2022-Mar-27 at 07:04

            We have found out what was happening. The root cause was the performances of the workers. To be properly working, composer expects the scanning of the dags to take less than 15% of the CPU ressources. If it exceeds this limit, it fails to schedule or update the dags. We have just taken bigger workers and it has worked well



            google cloud function Compute engine python api not shutting down instance on call to stop as expected
            Asked 2022-Feb-18 at 09:18

            I am using a google cloud function with python 3.9 My intention is to trigger this cloud function from an http trigger to stop a compute engine instance. The code for my cloud function is as below (entry point stop_server )



            Answered 2022-Feb-11 at 09:39

            The API stop() returns an Operation resource and not a string. You must poll the operation resource to get the status of the stop operation. This includes success and failure.

            Note: Your code is not calling execute() after setting up the request.



            ImportError: cannot import name 'tasks_v2' from '' (unknown location) in Python fastapi
            Asked 2022-Feb-09 at 17:35

            I'm trying to incorporate google-cloud-tasks Python client within my fastapi app. But it's giving me an import error like this:



            Answered 2022-Feb-09 at 17:35

            After doing some more research online I realized that installation of some packages is missed due to some existing packages. This issue helped me realize I need to reorder the position of google-cloud-tasks in my requirements.txt. So what I did was pretty simple, created a new virtualenv installed google-cloud-tasks as my first package and then installed everything else and finally the problem is solved.

            Long story short the issue is the order in which packages are installed and that's why some packages are getting missed.



            Colab: (0) UNIMPLEMENTED: DNN library is not found
            Asked 2022-Feb-08 at 19:27

            I have pretrained model for object detection (Google Colab + TensorFlow) inside Google Colab and I run it two-three times per week for new images I have and everything was fine for the last year till this week. Now when I try to run model I have this message:



            Answered 2022-Feb-07 at 09:19

            It happened the same to me last friday. I think it has something to do with Cuda instalation in Google Colab but I don't know exactly the reason



            from Google import Create_Service ModuleNotFoundError: No module named 'Google'
            Asked 2022-Jan-19 at 12:34

            I'm trying to use Gmail api in python to send email but I cant get past importing the Google module despite using "pip install --upgrade google-api-python-client" or "pip install google".

            However pip freeze shows:



            Answered 2021-Sep-20 at 10:55

            Implicit relative imports are not anymore supported as documented:

            There is no longer any implicit import machinery

            So if is in the same directory as the code you pasted, you have to reference it's realtive location explicitly.



            Tensorflow Object Detection API taking forever to install in a Google Colab and failing
            Asked 2021-Nov-19 at 00:16

            I am trying to install the Tensorflow Object Detection API on a Google Colab and the part that installs the API, shown below, takes a very long time to execute (in excess of one hour) and eventually fails to install.



            Answered 2021-Nov-19 at 00:16

            I have solved this problem with



            Import "google_auth_oauthlib.flow" could not be resolved
            Asked 2021-Nov-16 at 18:40

            In VSCODE using these specifications:



            Answered 2021-Nov-16 at 18:40

            Try pip uninstall google-auth-oauthlib and pip uninstall google-api-python-client google-auth-httplib2 google-auth-oauthlib then reinstall it with pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib



            How can I get a list of Google Cloud Functions using Google Python Client for Cloud Functions?
            Asked 2021-Nov-14 at 16:25

            I want to perform what I think is a fairly simple task - using python I would like to obtain a list of Google Cloud Functions in a given project and want to figure out the correct library for doing so.

            I'm trying to understand the myriad of repos at I can see there is

            however at it is stated:

            The maintainers of this repository recommend using Cloud Client Libraries for Python, where possible, for new code development

            and following the link there leads me to

            at which there is a link to

            This would seem to be the more appropriate library to use (pip install google-cloud-functions) for the reasons stated at

            The problem I have is that there seem to be many examples/samples that demonstrate the use of but less so for In fact my google-fu has failed me miserably because I can't find any examples of how I might use to achieve my task (i.e. get a list of Google Cloud Functions). The API documentation at is somewhat helpful however it seems rather lacking in sample code. One question I'm asking myself, for example, is should I be using


            or perhaps even something else.

            Can someone explain how I can use CloudFunctionsServiceClient or CloudFunctionsServiceAsyncClient to get a list of functions?



            Answered 2021-Nov-14 at 16:25

            Figured it out. These work



            Google Business Profile API readMask
            Asked 2021-Nov-12 at 16:46

            After the deprecation of my discovery url, I had to make some change on my code and now I get this error.

            googleapiclient.errors.HttpError:{*accountid*}/locations?filter=locationKey.placeId%3{*placeid*}&readMask=paths%3A+%22locations%28name%29%22%0A&alt=json returned "Request contains an invalid argument.". Details: "[{'@type': '', 'fieldViolations': [{'field': 'read_mask', 'description': 'Invalid field mask provided'}]}]">

            I am trying to use this end point accounts.locations.list

            I'm using :

            • python 3.8
            • google-api-python-client 2.29.0

            My current code look likes :



            Answered 2021-Nov-12 at 16:46

            You have not set the readMask correctly. I have done a similar task in Java and Google returns the results. readMask is a String type, and what I am going to provide you in the following line includes all fields. You can omit anyone which does not serve you. I am also writing the request code in Java, maybe it can help you better to convert into Python.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install google-api-python-client

            Install this library in a virtualenv using pip. virtualenv is a tool to create isolated Python environments. The basic problem it addresses is one of dependencies and versions, and indirectly permissions. With virtualenv, it's possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.


            See the docs folder for more detailed instructions and additional documentation.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • PyPI

            pip install google-api-python-client

          • CLONE
          • HTTPS


          • CLI

            gh repo clone googleapis/google-api-python-client

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link