Skip to content

DevSite Import: Samples #671

@grant

Description

@grant

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" %}
  1. Under OAuth, click Create New Client ID.
  2. Select Installed Application and Other and click Create Client ID.
  3. Copy the client ID and client secret values under Client ID for native application and paste into the client_id and client_secret fields 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" %}
  1. Under OAuth, click Create New Client ID.
  2. Select Web application and click Create Client ID.
  3. Copy the client ID and client secret values under Client ID for web application and paste into the client_id and client_secret fields in the downloaded client_secrets.json file.

Metadata

Metadata

Assignees

Labels

type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions