Book Image

Raspberry Pi Embedded Projects Hotshot

Book Image

Raspberry Pi Embedded Projects Hotshot

Overview of this book

Table of Contents (20 chapters)
Raspberry Pi Mechatronics Projects HOTSHOT
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up the parser for reminders and events


In this task, we will implement a module that will blink an LED to remind us about important events and appointments.

Prepare for lift off

The Google Data Python client library is required for this task. You also have to save some tasks in your calendar to test the implementation.

Engage thrusters

  1. Using the Python IDLE's editor, let's get started by creating a new file called calendars.py:

    import gdata.calendar.service
    import gdata.service
    import gdata.calendar
    import time
  2. We can get started by defining a Google Calendar object. We will define the username and password for our Google account:

    calendar_service = gdata.calendar.service.CalendarService()
    calendar_service.email = '[email protected]'
    calendar_service.password = 'password'
    calendar_service.ProgrammaticLogin()
  3. The calendar_query function performs a query for calendar events by defining a time frame as follows:

    query = gdata.calendar.service.CalendarEventQuery('default','private','full')
    query...