How to make list of datetimes using rrule
Question: I am creating my own .ics parser.

I am using icalendar python module. It works great but I would like to get
list of datetimes for events which have RRULE set.

I have starting date as datetime object instance and RRULE parsed like this:

    
    
    CaselessDict({'FREQ': ['MONTHLY'], 'INTERVAL': [1], 'BYDAY': ['4TH']})
    

But I cannot figure out how to make a list of datetimes from these two things.

Thank you


Answer: You can use the [python-dateutil](http://labix.org/python-dateutil) library
for generating `rrule`s, eg:

    
    
    from dateutil.rrule import rrule, MONTHLY
    
    dts = list(rrule(MONTHLY, interval=10, byweekday=4, count=3))
    # [datetime.datetime(2013, 11, 29, 15, 44, 45), datetime.datetime(2014, 9, 5, 15, 44, 45), datetime.datetime(2014, 9, 12, 15, 44, 45)]
    

Adjust arguments as needed.

