Matthew
Matthew

Reputation: 865

OAuth + Google Calendar + Python

I'm stuck..

Basically my goal is I want to be able to pull in end user's calendars, and parse their data daily. I don't need any interaction from them, just enough to authenticate them with OAuth. My current solution is a plain text file that it goes through as a dictionary and pulls in the calendar that way, but that's just asking for trouble. I am just getting my hands on OAuth but don't know how I'd use it in my instance.

Upvotes: 0

Views: 415

Answers (1)

Sean Lynch
Sean Lynch

Reputation: 6487

Take a look at this example for using OAuth2 to access Google Cloud Storage. You should be able to use it with relatively small tweaks to pull Google Calendar data (primarily changing the scope from https://www.googleapis.com/auth/devstorage.full_control to https://www.googleapis.com/auth/calendar

This example is also helpful, showing how to loop over all a user's Google+ activities and print them to the console. Especially take note of how to use from apiclient.discovery import build to build an API object to interacte with the service.

You can also play with the Google Calendar API using the OAuth 2.0 playground tool or look through the API using the APIs explorer.

Upvotes: 1

Related Questions