The python module python-gdata includes an pretty comprehensive example of using python to fetch google calendar events (calenderEvents.py)
No matter what I do, I only get 25 events returned. This is the default value of the maximum number of records returned.
The example script includes these comments
In reality, the server limits the result set intially returned. You can
use the max_results query parameter to allow the server to send additional
results back (see query parameter use in DateRangeQuery for more info).
I seem to have no idea how to use the max_results query parameter and I don't understand the documenation. Wondering if someone has cracked this.
This is one of my failed attempts (failed meaning it returns only 25 events)
def _PrintAllEventsOnDefaultCalendar(self):
"""Retrieves all events on the primary calendar for the authenticated user.
In reality, the server limits the result set intially returned. You can
use the max_results query parameter to allow the server to send additional
results back (see query parameter use in DateRangeQuery for more info).
Additionally, you can page through the results returned by using the
feed.GetNextLink().href value to get the location of the next set of
results."""
# original line:
#feed = self.cal_client.GetCalendarEventFeed()
# next line is one of my attempts
feed = self.cal_client.GetCalendarEventFeed(max_results='99')
print 'Events on Primary Calendar: %s' % (feed.title.text,)
for i, an_event in zip(xrange(len(feed.entry)), feed.entry):
print '\t%s. %s' % (i, an_event.title.text,)
for p, a_participant in zip(xrange(len(an_event.who)), an_event.who):
print '\t\t%s. %s' % (p, a_participant.email,)
print '\t\t\t%s' % (a_participant.name,)
if a_participant.attendee_status:
print '\t\t\t%s' % (a_participant.attendee_status.value,)