18
PyCon May 2016: Portland, OR BayPIGgies Aug 2016: Mountain View, CA Exploring G Suite & Google APIs (coding workshop; samples in Python) +Wesley Chun, @wescpy Developer Advocate Can't wait? pip{,3} install -U google-api-python-client AND console.developers.google.com SF Python project night Oct 2016: San Francisco, CA GDG NYC meetup Nov 2016: New York, NY Outline Overview Getting started Authorization boilerplate Motivational ideas Wrap-up [hacking + API usage examples]

G Suite & Google APIs coding workshop

Embed Size (px)

Citation preview

Page 1: G Suite & Google APIs coding workshop

PyConMay 2016: Portland, OR

BayPIGgiesAug 2016: Mountain View, CA

Exploring G Suite & Google APIs(coding workshop; samples in Python)

+Wesley Chun, @wescpyDeveloper Advocate

Can't wait? pip{,3} install -U google-api-python-clientAND console.developers.google.com

SF Python project nightOct 2016: San Francisco, CA

GDG NYC meetupNov 2016: New York, NY

Outline

● Overview● Getting started● Authorization boilerplate● Motivational ideas● Wrap-up● [hacking + API usage examples]

Page 2: G Suite & Google APIs coding workshop

Google APIs overview

Page 3: G Suite & Google APIs coding workshop

BUT... wait, there’s more...

Page 4: G Suite & Google APIs coding workshop

Getting Started with Google APIs

Page 5: G Suite & Google APIs coding workshop

Developers Console (devconsole)

Page 6: G Suite & Google APIs coding workshop
Page 7: G Suite & Google APIs coding workshop
Page 8: G Suite & Google APIs coding workshop
Page 9: G Suite & Google APIs coding workshop

OAuth2 scenarios● Varies on application type (where apps located)

○ Web (server) applications○ Installed (mobile & desktop computers) apps○ Service accounts (cloud/server-to-server)○ Client-side (JavaScript) apps○ Limited-input devices (game consoles, printers, cameras, etc.)

○ developers.google.com/identity/protocols/OAuth2○ TODAY: command-line script == "Installed"

Page 10: G Suite & Google APIs coding workshop
Page 11: G Suite & Google APIs coding workshop

Authorization boilerplate

Page 12: G Suite & Google APIs coding workshop

developers.google.com/discovery/libraries

Open source client libraries for many

languages, not just

SIMPLE

AUTHORIZED

Which do you choose?

Page 13: G Suite & Google APIs coding workshop

Simple API access

Authorized API access

Page 14: G Suite & Google APIs coding workshop

Motivational ideas

Write your own or see github.com/googledrive/zipextractor (JS)

Page 15: G Suite & Google APIs coding workshop

Build a Node.js customized reporting tool with our Sheets API codelab at g.co/codelabs/sheets (JS)

Check out our Node.js Markdown-to-Google Slides sample app demoing the Slides API

github.com/googlesamples/md2googleslides (JS)

Page 16: G Suite & Google APIs coding workshop

Wrap-up

Page 17: G Suite & Google APIs coding workshop

Alternative● Google Apps Script

○ What is it?■ Executes as JavaScript in Google's cloud■ Think “built-in” services vs. traditional API usage■ Convenient access to G Suite/Google Apps data■ Can also access other Google+external services■ developers.google.com/apps-script

○ Video resources■ goo.gl/1sXeuD (Apps Script intro)■ goo.gl/oAzBN9 (Google Maps & Gmail APIs)■ goo.gl/YuwZ0E (YouTube [Data] API)■ goo.gl/xSzGl4 (Google Forms)

Summary

● We’ve created great tech but can’t build everything(!)● APIs: our tech available for your apps; free?!?● Access w/favorite dev tool via Google APIs Client Library

○ Python, JavaScript (client + Node.js), Java, C#/.NET, Go, Dart, Ruby, PHP

○ Also mobile: Android (Java), iOS (Swift, Objective-C)● Build the next great thing!

Page 18: G Suite & Google APIs coding workshop

Reference● Blog + video Resources○ SETUP & BOILERPLATE

■ goo.gl/RbyTFD (new Google APIs project setup)■ goo.gl/KMfbeK (common Python boilerplate code review)

○ G SUITE APIs■ goo.gl/ZIgf8k and goo.gl/EySSQV (Google Drive API)■ goo.gl/pFYUQ2 (Gmail API)■ goo.gl/KuYMiq (Google Calendar API)■ goo.gl/N1RPwC and goo.gl/U6Oljn (Google Sheets API)■ goo.gl/o6EFwk (Google Slides API)■ goo.gl/Yb06ZC (Google Sheets & Slides APIs)

Thank you! Questions?

+Wesley Chungoogle.com/+WesleyChun

@wescpytwitter.com/wescpy

slide deckgoo.gl/NjCC0H