MCPcopy Index your code
hub / github.com/googleapis/google-api-python-client / main

Function main

samples/service_account/tasks.py:40–59  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

38
39
40def main(argv):
41 # Load the json format key that you downloaded from the Google API
42 # Console when you created your service account. For p12 keys, use the
43 # from_p12_keyfile method of ServiceAccountCredentials and specify the
44 # service account email address, p12 keyfile, and scopes.
45 credentials = ServiceAccountCredentials.from_json_keyfile_name(
46 "service-account-abcdef123456.json",
47 scopes="https://www.googleapis.com/auth/tasks",
48 )
49
50 # Create an httplib2.Http object to handle our HTTP requests and authorize
51 # it with the Credentials.
52 http = httplib2.Http()
53 http = credentials.authorize(http)
54
55 service = build("tasks", "v1", http=http)
56
57 # List all the tasklists for the account.
58 lists = service.tasklists().list().execute(http=http)
59 pprint.pprint(lists)
60
61
62if __name__ == "__main__":

Callers 1

tasks.pyFile · 0.70

Calls 3

buildFunction · 0.90
authorizeMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…