SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
Exploring MORE Google
(Cloud) APIs with Python
Wesley Chun
Developer Advocate, Google
Agenda
1
Introduction
2
Google APIs
review
3
G Suite APIs
4
Hangouts Chat bot
framework
5
GCP APIs
6
Wrap-up
01
Introduction
G Suite Dev Show
goo.gl/JpBQ40
About the speaker
● Developer Advocate, Google Cloud
● Mission: enable current and future developers to be successful using
Google Cloud and other Google developer tools, APIs, and platforms
● Videos: host of the G Suite Dev Show on YouTube
● Blogs: developers.googleblog.com & gsuite-developers.googleblog.com
● Twitters: @wescpy, @GoogleDevs, @GSuiteDevs
● Background
● Software engineer & architect for 20+ years
● One of the original Yahoo!Mail engineers
● Author of bestselling "Core Python" books (corepython.com)
● Teacher and technical instructor since 1983
● Fellow of the Python Software Foundation
02
Google APIs
review
BUT
... wait, there’s more...
The first word on Security
Authentication ("authn") vs authorization ("authz")
● authn: you are who you say you are
○ login & passwd
○ handprint authentication
○ retina scan
● authz: okay, you are who you say you are, but can you haz data?
○ OAuth2 - mostly authz, but some authn
○ Mostly about 3rd-party access to data
○ Users must give YOUR code access to THEIR data
○ Most of the time when you see "auth", it refers to authz
● Some refer to this as "consent" vs. "credentials…" which is which?
● View application statistics
● En-/disable Google APIs
● Obtain application credentials
Using Google APIs
goo.gl/RbyTFD
Google APIs client
libraries; demos in
Others:
developers.google.com/
api-client-library
Python 2 or 3:
pip{3,} install -U
google-api-python-client
from googleapiclient import discovery
# Copy from project in DevConsole, or better yet, put into
# secure DB, encrypted store, credential server/proxy, etc.
API_KEY = ' ... '
# When using GCP APIs, we recommend OAuth2 service accounts!
# API information, i.e., (API='language', VERSION='v1')
SERVICE = discovery.build(API, VERSION, developerKey=API_KEY)
Simple API access
Authorized API access
OAuth boilerplate
goo.gl/KMfbeK
from googleapiclient import discovery
from httplib2 import Http
from oauth2client import file, client, tools
SCOPES = ... # at least one (string or array of strings)
# 'storage.json' - where to store OAuth2 tokens from API
# 'client_secret.json' - OAuth2 client ID & secret (download from DevConsole)
store = file.Storage('storage.json')
creds = store.get()
if not creds or creds.invalid:
flow = client.flow_from_clientsecrets('client_secret.json', SCOPES)
creds = tools.run_flow(flow, store)
# create API service endpoint; for example: API='sheets', VERSION='v4'
SERVICE = discovery.build(API, VERSION, http=creds.authorize(Http()))
OAuth2 or
API key
HTTP-based REST APIs 1
HTTP
2
Google APIs request-response workflow
● Application makes request
● Request received by service
● Process data, return response
● Results sent to application
(typical client-server model)
03
G Suite APIs
G Suite
Collaborate and be more productive with G Suite
List (first 100) files/folders in Google Drive
from __future__ import print_function
from googleapiclient import discovery
from httplib2 import Http
from oauth2client import file, client, tools
SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly'
store = file.Storage('storage.json')
creds = store.get()
if not creds or creds.invalid:
flow = client.flow_from_clientsecrets('client_secret.json', SCOPES)
creds = tools.run_flow(flow, store)
DRIVE = discovery.build('drive', 'v3', http=creds.authorize(Http()))
files = DRIVE.files().list().execute().get('files', [])
for f in files:
print(f['name'], f['mimeType'])
Listing your files
goo.gl/ZIgf8k
List (first 100) files/folders in Google Drivefrom __future__ import print_function
import os.path
import pickle
from google.auth.transport.requests import Request
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient import discovery
creds = None
SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly'
TOKENS = 'token.p' # where to store access & refresh tokens
if os.path.exists(TOKENS):
with open(TOKENS, 'rb') as token:
creds = pickle.load(token)
if not (creds and creds.valid):
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file('client_secret.json', SCOPES)
creds = flow.run_local_server()
with open(TOKENS, 'wb') as token:
pickle.dump(creds, token)
DRIVE = discovery.build('drive', 'v3', credentials=creds)
files = DRIVE.files().list().execute().get('files', [])
for f in files:
print(f['name'], f['mimeType'])
Listing your files
goo.gl/ZIgf8k
See developers.google.com/drive/api/v3/quickstart/python
Try our Node.js customized reporting tool codelab:
g.co/codelabs/sheets
Why use the Sheets API?
data visualization
customized reports
Sheets as a data source
Migrate SQL data to a Sheet
# read SQL data then create new spreadsheet & add rows into it
FIELDS = ('ID', 'Customer Name', 'Product Code',
'Units Ordered', 'Unit Price', 'Status')
cxn = sqlite3.connect('db.sqlite')
cur = cxn.cursor()
rows = cur.execute('SELECT * FROM orders').fetchall()
cxn.close()
rows.insert(0, FIELDS)
DATA = {'properties': {'title': 'Customer orders'}}
SHEET_ID = SHEETS.spreadsheets().create(body=DATA,
fields='spreadsheetId').execute().get('spreadsheetId')
SHEETS.spreadsheets().values().update(spreadsheetId=SHEET_ID, range='A1',
body={'values': rows}, valueInputOption='RAW').execute()
Migrate SQL data
to Sheets
goo.gl/N1RPwC
Format cells (frozen & bold row)
requests = [
# freeze row 1
{'updateSheetProperties': {
'properties': {'gridProperties': {'frozenRowCount': 1}},
'fields': 'gridProperties.frozenRowCount',
}},
# bold row 1
{'repeatCell': {
'range': {'startRowIndex': 0, 'endRowIndex': 1},
'cell': {'userEnteredFormat': {'textFormat': {'bold': True}}},
'fields': 'userEnteredFormat.textFormat.bold',
}},
]
SHEETS.spreadsheets().batchUpdate(body={'requests': requests},
spreadsheetId=SHEET_ID, fields='').execute()
Formatting cells
goo.gl/U6Oljn
Field masks (two types)
requests = [
# bold row 1
{'repeatCell': {
'range': {'startRowIndex': 0, 'endRowIndex': 1},
'cell': {'userEnteredFormat': {'textFormat': {'bold': True}}},
'fields': 'userEnteredFormat.textFormat.bold',
}},
]
SHEETS.spreadsheets().batchUpdate(body={'requests': requests},
spreadsheetId=SHEET_ID, fields='').execute()
Update requests
goo.gl/9kmAEf
Filter responses
goo.gl/U6Oljn
Try our Node.js BigQuery GitHub license analyzer codelab:
g.co/codelabs/slides
Why use the Slides API?
data visualization
presentable reports
Try our Node.js Markdown-to-Google-Slides generator:
github.com/googlesamples/md2googleslides
Why use the Slides API?
customized presentations
Replace text & images from template deck
requests = [
# (global) search-and-replace text
{'replaceAllText': {
'findText': '{{TITLE}}',
'replaceText': 'Hello World!',
}},
# replace text-based image placeholders (global)
{'replaceAllShapesWithImage': {
'imageUrl': IMG_URL, # link to product logo
'replaceMethod': 'CENTER_INSIDE',
'containsText': {'text': '{{LOGO}}'},
}},
]
SLIDES.presentations().batchUpdate(body={'requests': requests},
presentationId=DECK_ID, fields='').execute()
Replacing text
and images
goo.gl/o6EFwk
Display Gmail threads (& # of messages)
# get all "busy" mail threads & display (non-blank) Subject lines
threads = GMAIL.users().threads().list(userId='me',
fields='threads').execute().get('threads', [])
for thread in threads:
tdata = GMAIL.users().threads().get(userId='me', id=thread['id'],
format='metadata', metadataHeaders=['subject'],
fields='messages/payload/headers(name,value)').execute()
if 'messages' not in tdata:
continue
if len(tdata['messages']) > 10:
msg = tdata['messages'][0]['payload']
subject = ''
for header in msg['headers']:
if header['name'] == 'Subject':
subject = header['value']
break
if subject:
print('%2d message(s) in thread: %s' % (
len(tdata['messages']), subject))
Gmail threads
goo.gl/pFYUQ2
Updating Gmail email signatures
GMAIL = discovery.build('gmail', 'v1', http=creds.authorize(Http()))
DATA = {'signature': 'I love Python!'}
addresses = GMAIL.users().settings().sendAs().list(userId='me',
fields='sendAs(isPrimary,sendAsEmail)').execute().get('sendAs')
for address in addresses:
if address['isPrimary']:
break
rsp = GMAIL.users().settings().sendAs().patch(userId='me',
sendAsEmail=address['sendAsEmail'], body=DATA).execute()
print("Primary address signature changed to '%s'" % rsp['signature'])
Gmail signatures
goo.gl/GbAOvb
Creating events in Calendar
# define event data, then create event
TIMEZONE = 'America/Los_Angeles'
EVENT = {
'summary': 'Dinner with friends',
'start': {'dateTime': '2017-06-14T19:00:00', 'timeZone': TIMEZONE},
'end': {'dateTime': '2017-06-14T22:00:00', 'timeZone': TIMEZONE},
'attendees': [
{'email': 'friend1@example.com'},
{'email': 'friend2@example.com'},
],
}
GCAL.events().insert(calendarId='primary', body=EVENT,
sendNotifications=True, fields='').execute()
Modifying and
recurring events
goo.gl/J2XkXc
Creating events
goo.gl/KuYMiq
Mail merge
Mail merge
Mail merge
+
Mail merge
=
04
Hangouts Chat
bot framework
(and API)
Mail merge (template global search & replace)
requests = [
# (global) search-and-replace text
{'replaceAllText': {
'containsText': {'text': '{{TITLE}}'},
'replaceText': 'Hello World!',
}},
]
DOCS.documents().batchUpdate(body={'requests': requests},
documentId=DOC_ID, fields='').execute()
Mail merge
bit.ly/2W1xhNa
(video TBD)
● Not just for conversations
● Create microservice utilities
● Build chat bots to...
○ Automate workflows
○ Query for information
○ Other heavy-lifting
Hangouts Chat bots
(bot framework and API)
“I got to work deploying a
light-weight Flask app server…
and in less than an hour had a
working chatbot.”
Greg Meyers, Motorola Solutions CIO
goo.gl/1QeG51
Build bots for anyone, your org or your team… FAST
Traditional API workflow
Traditional APIs vs. Bot architecture
OAuth2
Bot architecture
"Hello World" (echo bot)
Google App Engine (Python+webapp2)
import json
import webapp2
class MainPage(webapp2.RequestHandler):
def post(self):
self.response.headers['Content-Type'] = 'application/json'
event = json.loads(self.request.body)
if event['type'] == 'MESSAGE':
text = 'Hi %s. You sent: %s' % (
event['user']['displayName'], event['message']['text'])
self.response.out.write(json.dumps({'text': text}))
app = webapp2.WSGIApplication([('/', MainPage)], debug=True)
PY
Hangouts Chat
bots
goo.gl/jt3FqK
"Hello World" (echo bot)
Python+Flask (GAE or other hosting)
from flask import Flask, request, json
app = Flask(__name__)
@app.route('/', methods=['POST'])
def on_event():
event = request.get_json()
msg = {}
if event['type'] == 'MESSAGE':
text = 'Hi {}. You sent: {}'.format(
event['user']['displayName'], event['message']['text'])
msg = {'text': text}
return json.jsonify(msg)
PY
Hangouts Chat
bots
goo.gl/jt3FqK
05
GCP APIs
GCP
Build, innovate, and scale with Google Cloud Platform
BigQuery: querying Shakespeare words
TITLE = "The top 10 most common words in all of Shakespeare's works"
QUERY = '''
SELECT LOWER(word) AS word, sum(word_count) AS count
FROM [bigquery-public-data:samples.shakespeare]
GROUP BY word ORDER BY count DESC LIMIT 10
'''
rsp = BQ.query(body={'query': QUERY}, projectId=PROJ_ID).execute()
print('n*** Results for %r:n' % TITLE)
for col in rsp['schema']['fields']: # HEADERS
print(col['name'].upper(), end='t')
print()
for row in rsp['rows']: # DATA
for col in row['f']:
print(col['v'], end='t')
print()
Top 10 most common Shakespeare words
$ python bq_shake.py
*** Results for "The most common words in all of Shakespeare's works":
WORD COUNT
the 29801
and 27529
i 21029
to 20957
of 18514
a 15370
you 14010
my 12936
in 11722
that 11519
Simple sentiment & classification analysis
data = {'type': 'PLAIN_TEXT', 'content': '''
Google, headquartered in Mountain View, unveiled the new Android
phone at the Consumer Electronics Show. Sundar Pichai said in
his keynote that users love their new Android phones.'''
# sentiment analysis followed by content classification
sentiment = NL.documents().analyzeSentiment(
body={'document': data}).execute().get('documentSentiment')
print('TEXT:', text)
print('nSENTIMENT: score (%s), magnitude (%s)' % (
sentiment['score'], sentiment['magnitude']))
print('nCATEGORIES:')
categories = NL.documents().classifyText(
body={'document': data}).execute().get('categories')
for cat in categories:
print ('* %s (%s)' % (cat['name'][1:], cat['confidence']))
Simple sentiment & classification analysis
$ python nl_sent_class.py
TEXT: Google, headquartered in Mountain View, unveiled the new Android
phone at the Consumer Electronics Show. Sundar Pichai said in
his keynote that users love their new Android phones.
SENTIMENT: score (0.3), magnitude (0.6)
CATEGORIES:
* Internet & Telecom (0.76)
* Computers & Electronics (0.64)
* News (0.56)
06
Summary
References
● G Suite, Google Apps Script documentation & open source repos
○ developers.google.com/gsuite
○ developers.google.com/apps-script
○ github.com/gsuitedevs
● Google Cloud Platform (GCP) documentation & open source repos
○ cloud.google.com/gcp
○ cloud.google.com/docs
○ github.com/GoogleCloudPlatform/{python,nodejs}-docs-samples
○ Know AWS? Compare w/GCP at: cloud.google.com/docs/compare/aws
● Google APIs Client Libraries (G Suite & GCP) & Google Cloud SDK (GCP-only)
○ developers.google.com/api-client-library
○ cloud.google.com/sdk
More references
● Relevant videos
○ goo.gl/RbyTFD (new Google APIs project setup)
○ goo.gl/KMfbeK (common Python OAuth2 boilerplate code review)
○ goo.gl/ZIgf8k (APIs intro codelab [Drive API])
● Relevant codelabs
○ g.co/codelabs/gsuite-apis-intro (Drive API)
○ g.co/codelabs/apps-script-intro
○ codelabs.developers.google.com/codelabs/cloud-app-engine-python
○ codelabs.developers.google.com/codelabs/cloud-starting-cloudfunctions
Other Google APIs & platforms
● Firebase
○ firebase.google.com
● Google Data Studio (Data Visualization, dashboards, etc.)
○ marketingplatform.google.com/about/data-studio
● Actions on Google/Assistant/DialogFlow
○ developers.google.com/actions
● YouTube (Data, Analytics, and Livestreaming APIs)
○ developers.google.com/youtube
● Google Maps (Maps, Routes, and Places APIs)
○ developers.google.com/maps
Thank you! Questions?
Wesley Chun
@wescpy
Progress bars: goo.gl/69EJVw

Contenu connexe

Tendances

web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a bossFrancisco Ribeiro
 
What is new in Notes & Domino Deleopment V10.x
What is new in Notes & Domino Deleopment V10.xWhat is new in Notes & Domino Deleopment V10.x
What is new in Notes & Domino Deleopment V10.xUlrich Krause
 
EmberConf 2015 – Ambitious UX for Ambitious Apps
EmberConf 2015 – Ambitious UX for Ambitious AppsEmberConf 2015 – Ambitious UX for Ambitious Apps
EmberConf 2015 – Ambitious UX for Ambitious AppsLauren Elizabeth Tan
 
Python Code Camp for Professionals 3/4
Python Code Camp for Professionals 3/4Python Code Camp for Professionals 3/4
Python Code Camp for Professionals 3/4DEVCON
 
Python Code Camp for Professionals 4/4
Python Code Camp for Professionals 4/4Python Code Camp for Professionals 4/4
Python Code Camp for Professionals 4/4DEVCON
 
Web2py Code Lab
Web2py Code LabWeb2py Code Lab
Web2py Code LabColin Su
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with VaadinPeter Lehto
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009Robbie Cheng
 
Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!Kacper Gunia
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegapyangdj
 
Laporan multi client
Laporan multi clientLaporan multi client
Laporan multi clientichsanbarokah
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!Luca Lusso
 
Intorduction of Playframework
Intorduction of PlayframeworkIntorduction of Playframework
Intorduction of Playframeworkmaltiyadav
 
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016Kacper Gunia
 
Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/ServletSunil OS
 
Learning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersLearning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersKathy Brown
 

Tendances (19)

web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a boss
 
What is new in Notes & Domino Deleopment V10.x
What is new in Notes & Domino Deleopment V10.xWhat is new in Notes & Domino Deleopment V10.x
What is new in Notes & Domino Deleopment V10.x
 
The IoC Hydra
The IoC HydraThe IoC Hydra
The IoC Hydra
 
EmberConf 2015 – Ambitious UX for Ambitious Apps
EmberConf 2015 – Ambitious UX for Ambitious AppsEmberConf 2015 – Ambitious UX for Ambitious Apps
EmberConf 2015 – Ambitious UX for Ambitious Apps
 
Python Code Camp for Professionals 3/4
Python Code Camp for Professionals 3/4Python Code Camp for Professionals 3/4
Python Code Camp for Professionals 3/4
 
Python Code Camp for Professionals 4/4
Python Code Camp for Professionals 4/4Python Code Camp for Professionals 4/4
Python Code Camp for Professionals 4/4
 
Web2py Code Lab
Web2py Code LabWeb2py Code Lab
Web2py Code Lab
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with Vaadin
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009
 
Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegap
 
Laporan multi client
Laporan multi clientLaporan multi client
Laporan multi client
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!
 
Intorduction of Playframework
Intorduction of PlayframeworkIntorduction of Playframework
Intorduction of Playframework
 
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016
 
Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/Servlet
 
Learning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersLearning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client Developers
 

Similaire à Exploring MORE Google (Cloud) APIs with Python

Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & morePower your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & morewesley chun
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...wesley chun
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptwesley chun
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIswesley chun
 
Using Google (Cloud) APIs
Using Google (Cloud) APIsUsing Google (Cloud) APIs
Using Google (Cloud) APIswesley chun
 
Integrating dialog flow (api.ai) into qiscus sdk chat application
Integrating dialog flow (api.ai) into qiscus sdk chat applicationIntegrating dialog flow (api.ai) into qiscus sdk chat application
Integrating dialog flow (api.ai) into qiscus sdk chat applicationErick Ranes Akbar Mawuntu
 
Exploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewExploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewwesley chun
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Startedguest1af57e
 
Programming Google apps with the G Suite APIs
Programming Google apps with the G Suite APIsProgramming Google apps with the G Suite APIs
Programming Google apps with the G Suite APIsDevFest DC
 
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides, Apps Scri...
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides, Apps Scri...Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides, Apps Scri...
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides, Apps Scri...wesley chun
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBMongoDB
 
How to implement authorization in your backend with AWS IAM
How to implement authorization in your backend with AWS IAMHow to implement authorization in your backend with AWS IAM
How to implement authorization in your backend with AWS IAMProvectus
 
Capture, record, clip, embed and play, search: video from newbie to ninja
Capture, record, clip, embed and play, search: video from newbie to ninjaCapture, record, clip, embed and play, search: video from newbie to ninja
Capture, record, clip, embed and play, search: video from newbie to ninjaVito Flavio Lorusso
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecturepostrational
 
12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocratJonathan Linowes
 
Cloud Endpoints _Polymer_ Material design by Martin Görner
Cloud Endpoints_Polymer_Material design by Martin GörnerCloud Endpoints_Polymer_Material design by Martin Görner
Cloud Endpoints _Polymer_ Material design by Martin GörnerEuropean Innovation Academy
 
Easy Path to Machine Learning (2019)
Easy Path to Machine Learning (2019)Easy Path to Machine Learning (2019)
Easy Path to Machine Learning (2019)wesley chun
 
Using Play Framework 2 in production
Using Play Framework 2 in productionUsing Play Framework 2 in production
Using Play Framework 2 in productionChristian Papauschek
 
Getting started using Google APIs (2019)
Getting started using Google APIs (2019)Getting started using Google APIs (2019)
Getting started using Google APIs (2019)wesley chun
 

Similaire à Exploring MORE Google (Cloud) APIs with Python (20)

Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & morePower your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
 
Using Google (Cloud) APIs
Using Google (Cloud) APIsUsing Google (Cloud) APIs
Using Google (Cloud) APIs
 
Integrating dialog flow (api.ai) into qiscus sdk chat application
Integrating dialog flow (api.ai) into qiscus sdk chat applicationIntegrating dialog flow (api.ai) into qiscus sdk chat application
Integrating dialog flow (api.ai) into qiscus sdk chat application
 
Exploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewExploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overview
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
 
Programming Google apps with the G Suite APIs
Programming Google apps with the G Suite APIsProgramming Google apps with the G Suite APIs
Programming Google apps with the G Suite APIs
 
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides, Apps Scri...
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides, Apps Scri...Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides, Apps Scri...
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides, Apps Scri...
 
Goa tutorial
Goa tutorialGoa tutorial
Goa tutorial
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
 
How to implement authorization in your backend with AWS IAM
How to implement authorization in your backend with AWS IAMHow to implement authorization in your backend with AWS IAM
How to implement authorization in your backend with AWS IAM
 
Capture, record, clip, embed and play, search: video from newbie to ninja
Capture, record, clip, embed and play, search: video from newbie to ninjaCapture, record, clip, embed and play, search: video from newbie to ninja
Capture, record, clip, embed and play, search: video from newbie to ninja
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecture
 
12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat
 
Cloud Endpoints _Polymer_ Material design by Martin Görner
Cloud Endpoints_Polymer_Material design by Martin GörnerCloud Endpoints_Polymer_Material design by Martin Görner
Cloud Endpoints _Polymer_ Material design by Martin Görner
 
Easy Path to Machine Learning (2019)
Easy Path to Machine Learning (2019)Easy Path to Machine Learning (2019)
Easy Path to Machine Learning (2019)
 
Using Play Framework 2 in production
Using Play Framework 2 in productionUsing Play Framework 2 in production
Using Play Framework 2 in production
 
Getting started using Google APIs (2019)
Getting started using Google APIs (2019)Getting started using Google APIs (2019)
Getting started using Google APIs (2019)
 

Plus de wesley chun

Easy path to machine learning (2023-2024)
Easy path to machine learning (2023-2024)Easy path to machine learning (2023-2024)
Easy path to machine learning (2023-2024)wesley chun
 
Powerful Google developer tools for immediate impact! (2023-24 B)
Powerful Google developer tools for immediate impact! (2023-24 B)Powerful Google developer tools for immediate impact! (2023-24 B)
Powerful Google developer tools for immediate impact! (2023-24 B)wesley chun
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Pythonwesley chun
 
Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)wesley chun
 
Powerful Google developer tools for immediate impact! (2023-24 A)
Powerful Google developer tools for immediate impact! (2023-24 A)Powerful Google developer tools for immediate impact! (2023-24 A)
Powerful Google developer tools for immediate impact! (2023-24 A)wesley chun
 
Serverless Computing with Python
Serverless Computing with PythonServerless Computing with Python
Serverless Computing with Pythonwesley chun
 
Easy path to machine learning (2022)
Easy path to machine learning (2022)Easy path to machine learning (2022)
Easy path to machine learning (2022)wesley chun
 
Google... more than just a cloud
Google... more than just a cloudGoogle... more than just a cloud
Google... more than just a cloudwesley chun
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIswesley chun
 
Serverless computing with Google Cloud
Serverless computing with Google CloudServerless computing with Google Cloud
Serverless computing with Google Cloudwesley chun
 
Serverless Computing with Google Cloud
Serverless Computing with Google CloudServerless Computing with Google Cloud
Serverless Computing with Google Cloudwesley chun
 
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud RunDesigning flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Runwesley chun
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloudwesley chun
 
Easy path to machine learning (Spring 2021)
Easy path to machine learning (Spring 2021)Easy path to machine learning (Spring 2021)
Easy path to machine learning (Spring 2021)wesley chun
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Pythonwesley chun
 
Serverless Computing with Google Cloud
Serverless Computing with Google CloudServerless Computing with Google Cloud
Serverless Computing with Google Cloudwesley chun
 
Run your code serverlessly on Google's open cloud
Run your code serverlessly on Google's open cloudRun your code serverlessly on Google's open cloud
Run your code serverlessly on Google's open cloudwesley chun
 
Serverless Computing with Python
Serverless Computing with PythonServerless Computing with Python
Serverless Computing with Pythonwesley chun
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloudwesley chun
 
Easy path to machine learning (Spring 2020)
Easy path to machine learning (Spring 2020)Easy path to machine learning (Spring 2020)
Easy path to machine learning (Spring 2020)wesley chun
 

Plus de wesley chun (20)

Easy path to machine learning (2023-2024)
Easy path to machine learning (2023-2024)Easy path to machine learning (2023-2024)
Easy path to machine learning (2023-2024)
 
Powerful Google developer tools for immediate impact! (2023-24 B)
Powerful Google developer tools for immediate impact! (2023-24 B)Powerful Google developer tools for immediate impact! (2023-24 B)
Powerful Google developer tools for immediate impact! (2023-24 B)
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Python
 
Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
 
Powerful Google developer tools for immediate impact! (2023-24 A)
Powerful Google developer tools for immediate impact! (2023-24 A)Powerful Google developer tools for immediate impact! (2023-24 A)
Powerful Google developer tools for immediate impact! (2023-24 A)
 
Serverless Computing with Python
Serverless Computing with PythonServerless Computing with Python
Serverless Computing with Python
 
Easy path to machine learning (2022)
Easy path to machine learning (2022)Easy path to machine learning (2022)
Easy path to machine learning (2022)
 
Google... more than just a cloud
Google... more than just a cloudGoogle... more than just a cloud
Google... more than just a cloud
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIs
 
Serverless computing with Google Cloud
Serverless computing with Google CloudServerless computing with Google Cloud
Serverless computing with Google Cloud
 
Serverless Computing with Google Cloud
Serverless Computing with Google CloudServerless Computing with Google Cloud
Serverless Computing with Google Cloud
 
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud RunDesigning flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloud
 
Easy path to machine learning (Spring 2021)
Easy path to machine learning (Spring 2021)Easy path to machine learning (Spring 2021)
Easy path to machine learning (Spring 2021)
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Python
 
Serverless Computing with Google Cloud
Serverless Computing with Google CloudServerless Computing with Google Cloud
Serverless Computing with Google Cloud
 
Run your code serverlessly on Google's open cloud
Run your code serverlessly on Google's open cloudRun your code serverlessly on Google's open cloud
Run your code serverlessly on Google's open cloud
 
Serverless Computing with Python
Serverless Computing with PythonServerless Computing with Python
Serverless Computing with Python
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloud
 
Easy path to machine learning (Spring 2020)
Easy path to machine learning (Spring 2020)Easy path to machine learning (Spring 2020)
Easy path to machine learning (Spring 2020)
 

Dernier

Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
Intellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxIntellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxBipin Adhikari
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxeditsforyah
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleanscorenetworkseo
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 

Dernier (20)

Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
Intellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxIntellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptx
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptx
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleans
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 

Exploring MORE Google (Cloud) APIs with Python

  • 1. Exploring MORE Google (Cloud) APIs with Python Wesley Chun Developer Advocate, Google Agenda 1 Introduction 2 Google APIs review 3 G Suite APIs 4 Hangouts Chat bot framework 5 GCP APIs 6 Wrap-up
  • 2. 01 Introduction G Suite Dev Show goo.gl/JpBQ40 About the speaker ● Developer Advocate, Google Cloud ● Mission: enable current and future developers to be successful using Google Cloud and other Google developer tools, APIs, and platforms ● Videos: host of the G Suite Dev Show on YouTube ● Blogs: developers.googleblog.com & gsuite-developers.googleblog.com ● Twitters: @wescpy, @GoogleDevs, @GSuiteDevs ● Background ● Software engineer & architect for 20+ years ● One of the original Yahoo!Mail engineers ● Author of bestselling "Core Python" books (corepython.com) ● Teacher and technical instructor since 1983 ● Fellow of the Python Software Foundation
  • 3.
  • 6.
  • 7. The first word on Security Authentication ("authn") vs authorization ("authz") ● authn: you are who you say you are ○ login & passwd ○ handprint authentication ○ retina scan ● authz: okay, you are who you say you are, but can you haz data? ○ OAuth2 - mostly authz, but some authn ○ Mostly about 3rd-party access to data ○ Users must give YOUR code access to THEIR data ○ Most of the time when you see "auth", it refers to authz ● Some refer to this as "consent" vs. "credentials…" which is which?
  • 8. ● View application statistics ● En-/disable Google APIs ● Obtain application credentials Using Google APIs goo.gl/RbyTFD Google APIs client libraries; demos in Others: developers.google.com/ api-client-library Python 2 or 3: pip{3,} install -U google-api-python-client
  • 9. from googleapiclient import discovery # Copy from project in DevConsole, or better yet, put into # secure DB, encrypted store, credential server/proxy, etc. API_KEY = ' ... ' # When using GCP APIs, we recommend OAuth2 service accounts! # API information, i.e., (API='language', VERSION='v1') SERVICE = discovery.build(API, VERSION, developerKey=API_KEY) Simple API access Authorized API access OAuth boilerplate goo.gl/KMfbeK from googleapiclient import discovery from httplib2 import Http from oauth2client import file, client, tools SCOPES = ... # at least one (string or array of strings) # 'storage.json' - where to store OAuth2 tokens from API # 'client_secret.json' - OAuth2 client ID & secret (download from DevConsole) store = file.Storage('storage.json') creds = store.get() if not creds or creds.invalid: flow = client.flow_from_clientsecrets('client_secret.json', SCOPES) creds = tools.run_flow(flow, store) # create API service endpoint; for example: API='sheets', VERSION='v4' SERVICE = discovery.build(API, VERSION, http=creds.authorize(Http()))
  • 10. OAuth2 or API key HTTP-based REST APIs 1 HTTP 2 Google APIs request-response workflow ● Application makes request ● Request received by service ● Process data, return response ● Results sent to application (typical client-server model)
  • 11. 03 G Suite APIs G Suite Collaborate and be more productive with G Suite
  • 12. List (first 100) files/folders in Google Drive from __future__ import print_function from googleapiclient import discovery from httplib2 import Http from oauth2client import file, client, tools SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly' store = file.Storage('storage.json') creds = store.get() if not creds or creds.invalid: flow = client.flow_from_clientsecrets('client_secret.json', SCOPES) creds = tools.run_flow(flow, store) DRIVE = discovery.build('drive', 'v3', http=creds.authorize(Http())) files = DRIVE.files().list().execute().get('files', []) for f in files: print(f['name'], f['mimeType']) Listing your files goo.gl/ZIgf8k List (first 100) files/folders in Google Drivefrom __future__ import print_function import os.path import pickle from google.auth.transport.requests import Request from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient import discovery creds = None SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly' TOKENS = 'token.p' # where to store access & refresh tokens if os.path.exists(TOKENS): with open(TOKENS, 'rb') as token: creds = pickle.load(token) if not (creds and creds.valid): if creds and creds.expired and creds.refresh_token: creds.refresh(Request()) else: flow = InstalledAppFlow.from_client_secrets_file('client_secret.json', SCOPES) creds = flow.run_local_server() with open(TOKENS, 'wb') as token: pickle.dump(creds, token) DRIVE = discovery.build('drive', 'v3', credentials=creds) files = DRIVE.files().list().execute().get('files', []) for f in files: print(f['name'], f['mimeType']) Listing your files goo.gl/ZIgf8k See developers.google.com/drive/api/v3/quickstart/python
  • 13. Try our Node.js customized reporting tool codelab: g.co/codelabs/sheets Why use the Sheets API? data visualization customized reports Sheets as a data source Migrate SQL data to a Sheet # read SQL data then create new spreadsheet & add rows into it FIELDS = ('ID', 'Customer Name', 'Product Code', 'Units Ordered', 'Unit Price', 'Status') cxn = sqlite3.connect('db.sqlite') cur = cxn.cursor() rows = cur.execute('SELECT * FROM orders').fetchall() cxn.close() rows.insert(0, FIELDS) DATA = {'properties': {'title': 'Customer orders'}} SHEET_ID = SHEETS.spreadsheets().create(body=DATA, fields='spreadsheetId').execute().get('spreadsheetId') SHEETS.spreadsheets().values().update(spreadsheetId=SHEET_ID, range='A1', body={'values': rows}, valueInputOption='RAW').execute() Migrate SQL data to Sheets goo.gl/N1RPwC
  • 14. Format cells (frozen & bold row) requests = [ # freeze row 1 {'updateSheetProperties': { 'properties': {'gridProperties': {'frozenRowCount': 1}}, 'fields': 'gridProperties.frozenRowCount', }}, # bold row 1 {'repeatCell': { 'range': {'startRowIndex': 0, 'endRowIndex': 1}, 'cell': {'userEnteredFormat': {'textFormat': {'bold': True}}}, 'fields': 'userEnteredFormat.textFormat.bold', }}, ] SHEETS.spreadsheets().batchUpdate(body={'requests': requests}, spreadsheetId=SHEET_ID, fields='').execute() Formatting cells goo.gl/U6Oljn Field masks (two types) requests = [ # bold row 1 {'repeatCell': { 'range': {'startRowIndex': 0, 'endRowIndex': 1}, 'cell': {'userEnteredFormat': {'textFormat': {'bold': True}}}, 'fields': 'userEnteredFormat.textFormat.bold', }}, ] SHEETS.spreadsheets().batchUpdate(body={'requests': requests}, spreadsheetId=SHEET_ID, fields='').execute() Update requests goo.gl/9kmAEf Filter responses goo.gl/U6Oljn
  • 15. Try our Node.js BigQuery GitHub license analyzer codelab: g.co/codelabs/slides Why use the Slides API? data visualization presentable reports Try our Node.js Markdown-to-Google-Slides generator: github.com/googlesamples/md2googleslides Why use the Slides API? customized presentations
  • 16. Replace text & images from template deck requests = [ # (global) search-and-replace text {'replaceAllText': { 'findText': '{{TITLE}}', 'replaceText': 'Hello World!', }}, # replace text-based image placeholders (global) {'replaceAllShapesWithImage': { 'imageUrl': IMG_URL, # link to product logo 'replaceMethod': 'CENTER_INSIDE', 'containsText': {'text': '{{LOGO}}'}, }}, ] SLIDES.presentations().batchUpdate(body={'requests': requests}, presentationId=DECK_ID, fields='').execute() Replacing text and images goo.gl/o6EFwk Display Gmail threads (& # of messages) # get all "busy" mail threads & display (non-blank) Subject lines threads = GMAIL.users().threads().list(userId='me', fields='threads').execute().get('threads', []) for thread in threads: tdata = GMAIL.users().threads().get(userId='me', id=thread['id'], format='metadata', metadataHeaders=['subject'], fields='messages/payload/headers(name,value)').execute() if 'messages' not in tdata: continue if len(tdata['messages']) > 10: msg = tdata['messages'][0]['payload'] subject = '' for header in msg['headers']: if header['name'] == 'Subject': subject = header['value'] break if subject: print('%2d message(s) in thread: %s' % ( len(tdata['messages']), subject)) Gmail threads goo.gl/pFYUQ2
  • 17. Updating Gmail email signatures GMAIL = discovery.build('gmail', 'v1', http=creds.authorize(Http())) DATA = {'signature': 'I love Python!'} addresses = GMAIL.users().settings().sendAs().list(userId='me', fields='sendAs(isPrimary,sendAsEmail)').execute().get('sendAs') for address in addresses: if address['isPrimary']: break rsp = GMAIL.users().settings().sendAs().patch(userId='me', sendAsEmail=address['sendAsEmail'], body=DATA).execute() print("Primary address signature changed to '%s'" % rsp['signature']) Gmail signatures goo.gl/GbAOvb Creating events in Calendar # define event data, then create event TIMEZONE = 'America/Los_Angeles' EVENT = { 'summary': 'Dinner with friends', 'start': {'dateTime': '2017-06-14T19:00:00', 'timeZone': TIMEZONE}, 'end': {'dateTime': '2017-06-14T22:00:00', 'timeZone': TIMEZONE}, 'attendees': [ {'email': 'friend1@example.com'}, {'email': 'friend2@example.com'}, ], } GCAL.events().insert(calendarId='primary', body=EVENT, sendNotifications=True, fields='').execute() Modifying and recurring events goo.gl/J2XkXc Creating events goo.gl/KuYMiq
  • 20. 04 Hangouts Chat bot framework (and API) Mail merge (template global search & replace) requests = [ # (global) search-and-replace text {'replaceAllText': { 'containsText': {'text': '{{TITLE}}'}, 'replaceText': 'Hello World!', }}, ] DOCS.documents().batchUpdate(body={'requests': requests}, documentId=DOC_ID, fields='').execute() Mail merge bit.ly/2W1xhNa (video TBD)
  • 21. ● Not just for conversations ● Create microservice utilities ● Build chat bots to... ○ Automate workflows ○ Query for information ○ Other heavy-lifting Hangouts Chat bots (bot framework and API) “I got to work deploying a light-weight Flask app server… and in less than an hour had a working chatbot.” Greg Meyers, Motorola Solutions CIO goo.gl/1QeG51 Build bots for anyone, your org or your team… FAST
  • 22. Traditional API workflow Traditional APIs vs. Bot architecture OAuth2 Bot architecture "Hello World" (echo bot) Google App Engine (Python+webapp2) import json import webapp2 class MainPage(webapp2.RequestHandler): def post(self): self.response.headers['Content-Type'] = 'application/json' event = json.loads(self.request.body) if event['type'] == 'MESSAGE': text = 'Hi %s. You sent: %s' % ( event['user']['displayName'], event['message']['text']) self.response.out.write(json.dumps({'text': text})) app = webapp2.WSGIApplication([('/', MainPage)], debug=True) PY Hangouts Chat bots goo.gl/jt3FqK
  • 23. "Hello World" (echo bot) Python+Flask (GAE or other hosting) from flask import Flask, request, json app = Flask(__name__) @app.route('/', methods=['POST']) def on_event(): event = request.get_json() msg = {} if event['type'] == 'MESSAGE': text = 'Hi {}. You sent: {}'.format( event['user']['displayName'], event['message']['text']) msg = {'text': text} return json.jsonify(msg) PY Hangouts Chat bots goo.gl/jt3FqK 05 GCP APIs
  • 24. GCP Build, innovate, and scale with Google Cloud Platform BigQuery: querying Shakespeare words TITLE = "The top 10 most common words in all of Shakespeare's works" QUERY = ''' SELECT LOWER(word) AS word, sum(word_count) AS count FROM [bigquery-public-data:samples.shakespeare] GROUP BY word ORDER BY count DESC LIMIT 10 ''' rsp = BQ.query(body={'query': QUERY}, projectId=PROJ_ID).execute() print('n*** Results for %r:n' % TITLE) for col in rsp['schema']['fields']: # HEADERS print(col['name'].upper(), end='t') print() for row in rsp['rows']: # DATA for col in row['f']: print(col['v'], end='t') print()
  • 25. Top 10 most common Shakespeare words $ python bq_shake.py *** Results for "The most common words in all of Shakespeare's works": WORD COUNT the 29801 and 27529 i 21029 to 20957 of 18514 a 15370 you 14010 my 12936 in 11722 that 11519 Simple sentiment & classification analysis data = {'type': 'PLAIN_TEXT', 'content': ''' Google, headquartered in Mountain View, unveiled the new Android phone at the Consumer Electronics Show. Sundar Pichai said in his keynote that users love their new Android phones.''' # sentiment analysis followed by content classification sentiment = NL.documents().analyzeSentiment( body={'document': data}).execute().get('documentSentiment') print('TEXT:', text) print('nSENTIMENT: score (%s), magnitude (%s)' % ( sentiment['score'], sentiment['magnitude'])) print('nCATEGORIES:') categories = NL.documents().classifyText( body={'document': data}).execute().get('categories') for cat in categories: print ('* %s (%s)' % (cat['name'][1:], cat['confidence']))
  • 26. Simple sentiment & classification analysis $ python nl_sent_class.py TEXT: Google, headquartered in Mountain View, unveiled the new Android phone at the Consumer Electronics Show. Sundar Pichai said in his keynote that users love their new Android phones. SENTIMENT: score (0.3), magnitude (0.6) CATEGORIES: * Internet & Telecom (0.76) * Computers & Electronics (0.64) * News (0.56) 06 Summary
  • 27. References ● G Suite, Google Apps Script documentation & open source repos ○ developers.google.com/gsuite ○ developers.google.com/apps-script ○ github.com/gsuitedevs ● Google Cloud Platform (GCP) documentation & open source repos ○ cloud.google.com/gcp ○ cloud.google.com/docs ○ github.com/GoogleCloudPlatform/{python,nodejs}-docs-samples ○ Know AWS? Compare w/GCP at: cloud.google.com/docs/compare/aws ● Google APIs Client Libraries (G Suite & GCP) & Google Cloud SDK (GCP-only) ○ developers.google.com/api-client-library ○ cloud.google.com/sdk More references ● Relevant videos ○ goo.gl/RbyTFD (new Google APIs project setup) ○ goo.gl/KMfbeK (common Python OAuth2 boilerplate code review) ○ goo.gl/ZIgf8k (APIs intro codelab [Drive API]) ● Relevant codelabs ○ g.co/codelabs/gsuite-apis-intro (Drive API) ○ g.co/codelabs/apps-script-intro ○ codelabs.developers.google.com/codelabs/cloud-app-engine-python ○ codelabs.developers.google.com/codelabs/cloud-starting-cloudfunctions
  • 28. Other Google APIs & platforms ● Firebase ○ firebase.google.com ● Google Data Studio (Data Visualization, dashboards, etc.) ○ marketingplatform.google.com/about/data-studio ● Actions on Google/Assistant/DialogFlow ○ developers.google.com/actions ● YouTube (Data, Analytics, and Livestreaming APIs) ○ developers.google.com/youtube ● Google Maps (Maps, Routes, and Places APIs) ○ developers.google.com/maps Thank you! Questions? Wesley Chun @wescpy Progress bars: goo.gl/69EJVw