-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Notice: This DevSite page will soon be deleted per b/133171590. Please add this sample to GitHub if it is relevant still:
https://developers.google.com/api-client-library/python/samples/samples
Sample Applications
This page lists sources and information for sample scripts that demonstrate use of this library.
Before diving into these samples, you should see the Getting Started page. It has basic examples covering API keys, OAuth 2.0, web applications, and installed applications. These scripts are thoroughly commented to explain every step.
The Google APIs Client Library for Python is an open source project on Google Project Hosting. The library source code and many sample applications can be found there. Follow the instructions on the Installation page to install these samples. The samples cover various application types, library features, platforms, and specific APIs.
See the following page for a description of all available samples:
Sample Applications page
Running samples
Many of the samples use a client_secrets.json file described in the flow_from_clientsecrets() section of the OAuth 2.0 page. Before running a sample script, you need to update this file.
When running a command-line or Google App Engine script locally:
- {% include "_shared/apis/console/_navigate-to-credentials.html" %}
- Under OAuth, click Create New Client ID.
- Select Installed Application and Other and click Create Client ID.
- Copy the client ID and client secret values under Client ID for native application and paste into the
client_idandclient_secretfields in the downloaded client_secrets.json file.
When running a script as a web application or deployed Google App Engine script:
- {% include "_shared/apis/console/_navigate-to-credentials.html" %}
- Under OAuth, click Create New Client ID.
- Select Web application and click Create Client ID.
- Copy the client ID and client secret values under Client ID for web application and paste into the
client_idandclient_secretfields in the downloaded client_secrets.json file.