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 |
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 | |
| argv | list of string, the command-line parameters of the application. |
| name | string, name of the API. |
| version | string, version of the API. |
| doc | string, description of the application. Usually set to __doc__. |
| filename | Undocumented |
| scope | string, The OAuth scope used. |
| parents | list of argparse.ArgumentParser, additional command-line flags. |
| discovery | string, name of local discovery file (JSON). Use when discovery doc not available via URL. |
| file | string, 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. | |