def _recurring_component_to_events(component):
 rrule_as_str = component.get('rrule').to_ical()
 recur_rule = rrule.rrulestr(rrule_as_str, dtstart=component.decoded('dtstart'))
 recur_set = rrule.rruleset()
 recur_set.rrule(recur_rule)
 if ('exdate' in component):
  for exdate_line in component.decoded('exdate'):
   for exdate in exdate_line.dts:
    recur_set.exdate(exdate.dt)
 utcnow = now()
 later = (utcnow + datetime.timedelta(days=MAX_FUTURE))
 start_times = recur_set.between(utcnow, later)
 event_length = (component.decoded('dtend') - component.decoded('dtstart'))
 events = []
 for start in start_times:
  events.append({'start': start, 'end': (start + event_length), 'summary': component.decoded('summary'), 'uid': component.decoded('uid'), 'last_modified': component.decoded('last-modified')})
 return events

def _recurring_component_to_events ( component ) : rrule_as_str = component . get ( 'rrule' ) . to_ical ( ) recur_rule = rrule . rrulestr ( rrule_as_str , dtstart = component . decoded ( 'dtstart' ) ) recur_set = rrule . rruleset ( ) recur_set . rrule ( recur_rule ) if ( 'exdate' in component ) : for exdate_line in component . decoded ( 'exdate' ) : for exdate in exdate_line . dts : recur_set . exdate ( exdate . dt ) utcnow = now ( ) later = ( utcnow + datetime . timedelta ( days = MAX_FUTURE ) ) start_times = recur_set . between ( utcnow , later ) event_length = ( component . decoded ( 'dtend' ) - component . decoded ( 'dtstart' ) ) events = [ ] for start in start_times : events . append ( { 'start' : start , 'end' : ( start + event_length ) , 'summary' : component . decoded ( 'summary' ) , 'uid' : component . decoded ( 'uid' ) , 'last_modified' : component . decoded ( 'last-modified' ) } ) return events
given an icalendar component with an "rrule" return a list of events as dictionaries .