My favorites | Sign in
Google
                
Search
for
Updated Apr 02, 2007 by api.lliabraa
Labels: Calendar, Example
RunningCalendarExample  
Instructions for running the Google Calendar example script.

Introduction

These instructions will guide you through running the example script which illustrates performing common operations using the calendar modules.

Details

Execution Environment

Make sure that the required modules are in your Python Path. See DependencyModules for a list of things you may need to install.

Running the example

You can run the example from the main project directory by executing python samples/calendar/calendarExample.py --user your user name --pw your password --delete (true|false)

The example will run through a series of actions including printing the list of calendars, retrieving all events from the primary calendar of the authenticated user, querying for events based upon a full text query and a date range query, inserting a single occurrence and a recurring event, updating an event to change the title, adding an extended property to an event, adding a reminder to an event, and, optionally, cleaning up by deleting the created events.

Please see the docstrings within the code for more information about each action.

This example should get you started developing applications using the Google Calendar data API very quickly.

If you have any problems running this example, or any other questions about the Calendar data API, please visit the developer forum


Comment by mrgomel, Aug 04, 2007

Steps needed to get this example working (windows): 1. download & install elementtree (exe installer) 2. download & unzip gdata.py-1.0.6.zip 3. run "python.exe setup.py install" 4. run "python.exe calendarExample.py parameters?"

If you ommit the --delete flag, you will have to clean up ca. 6 sample items later on.

Comment by william.markito, Aug 14, 2007

Just a small problem that I got running the examples here in Brazil.

Since we have lot's of special chars like "é, á...", I had to add this to all prints, to get it working or setup sitecustomize.py at your ${pythondir}/lib/site-packages/

 title = '\t%s %s' % (i, an_event.title.text,)
      print title.encode('UTF-8')
Comment by mrdkap, Oct 09, 2007

WARNING WARNING If you run with the --delete True flag, and have any other calendars but your base one, this program will DELETE them with no backup, and no way to restore! THINK TWICE.

Comment by diogocolete, May 09, 2008

ç

Comment by srik.marella, Sep 01, 2008

hi, suppose if i used GoogleOwnCalendarsFeed?() insteadof GoogleCalendarEventFeed?() how to display calendar id's

Comment by srik.marella, Oct 04, 2008

This example works for only command line. Suppose if i wish to run in html how to execute this example. can anyone answer me

Comment by robforee, Feb 27, 2009

I have been studying the example and the docs and cannot seem to figure out how to get a cal_client.CalendarQuery??() to return sorted results...... after looking at the calendar serice source I tried this...

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

    query.start_min = '2009-01-22' 
     query.start_max = '2009-07-01' 
    query.params = 'orderby=starttime' 

but to no avail, my results come back un-sorted any clues??


Sign in to add a comment