module documentation

Utilities for making samples.

Consolidates a lot of code commonly repeated in sample applications.

Function init A common initialization routine for samples.
Variable __author__ Undocumented
def init(argv, name, version, doc, filename, scope=None, parents=[], discovery_filename=None):

A common initialization routine for samples.

Many of the sample applications do the same initialization, which has now been consolidated into this function. This function uses common idioms found in almost all the samples, i.e. for an API with name 'apiname', the credentials are stored in a file named apiname.dat, and the client_secrets.json file is stored in the same directory as the application main file.

Parameters
argvlist of string, the command-line parameters of the application.
namestring, name of the API.
versionstring, version of the API.
docstring, description of the application. Usually set to __doc__.
filenameUndocumented
scopestring, The OAuth scope used.
parentslist of argparse.ArgumentParser, additional command-line flags.
discovery_filenamestring, name of local discovery file (JSON). Use when discovery doc not available via URL.
filestring, filename of the application. Usually set to __file__.
Returns
A tuple of (service, flags), where service is the service object and flags is the parsed command-line flags.
__author__: str =

Undocumented