def dt2d(date):
    """
    Convert a datetime.datetime to datetime.date object
    """
return datetime.date(date.year, date.month, date.day)

def enumerate_dates(start, end):
    days = map(dt2d, drrule.rrule(drrule.DAILY, dtstart=start, until=end))
start_week = start + drel.relativedelta(weekday=drel.MO(-1))
end_week = end + drel.relativedelta(weekday=drel.MO(-1))
weeks = map(dt2d, drrule.rrule(drrule.WEEKLY, dtstart=start_week, until=
    end_week))
start_month = start.replace(day=1)
end_month = end.replace(day=1)
months = map(dt2d, drrule.rrule(drrule.MONTHLY, dtstart=start_month, until=
    end_month))
return days, weeks, months
if __name__ == '__main__':
    days, weeks, months = enumerate_dates(datetime.date(2010, 11, 28),
        datetime.date(2010, 12, 1))
print("""days: {d}
weeks: {w}
months: {m}""".format(d=map(str, days), w=map
    (str, weeks), m=map(str, months)))
Is there a consistent way to enumerate days/weeks/months between two dates?