3

Summary:

I'd like to use a Python script to automatically download events from a Google Calendar.

Detail:

I am making a Kindle based Heads-up display. The Kindle runs a python script every hour, and downloads weather and event information from the web. I'd also like it to fetch events for my kids' school. However, they are all on a Google Calendar, and I can't seem to find a way to download the events using Python.

What I have tried so far:

I have tried the example code here: https://developers.google.com/google-apps/calendar/quickstart/python but it needs a client_secret.json file.

I tried the suggested Wizard: https://console.developers.google.com/flows/enableapi?apiid=calendar but this feels like I'm getting into something too deep.

Isn't there just a way to fetch some events from a public calendar? I would even be happy to just copy/paste the text from the Agenda view of the calendar. If my browser can get this data, surely there must be a way.

Added: I am a complete newbie using things like Google Developers APIs, OAuth, etc.

Rocketmagnet
  • 5,656
  • 8
  • 36
  • 47
  • 1
    well according to the first link it says you need to enable the api for the calendar and download the client_secret.json file. That's going to be needed to authenticate with the api. – postelrich Sep 03 '15 at 13:25

2 Answers2

5

Wow, after a lot of digging, I discovered that it's easy! I can't believe nothing online mentions this.

I only discovered this when I created my own calendar, and found, in the settings page, there's a link to download my calendar in XML, ICAL or HTML format. So I just replaced the name of the calendar with that of the public calendar I want to use, and it worked!

Google Calendar in XML ICAL and HTML format

https://www.google.com/calendar/feeds/NAME_OF_CALENDAR%40googlemail.com/public/basic
Rocketmagnet
  • 5,656
  • 8
  • 36
  • 47
2

You can use the official API for Google calendar. More details, including documentation is provided at https://developers.google.com/api-client-library/python/apis/calendar/v3?hl=en

The .json file can be downloaded when you enable the api in the settings. As far as I know, this step cannot be done on a mobile device.

Mathew C.
  • 27
  • 2