lpil / icalendar

🗓️ A small library for reading and writing ICalendar files.
MIT License
103 stars 56 forks source link

Add RRULE parsing #44

Closed ericdude4 closed 4 years ago

ericdude4 commented 4 years ago

From the ICalendar spec: https://icalendar.org/iCalendar-RFC-5545/3-3-10-recurrence-rule.html

This adds the ability to generate event recurrences which appear within a time range.

ericdude4 commented 4 years ago

@lpil Does using the Steam module the way I have done here, immediately followed by Enum.to_list() defeat the purpose of trying to keep memory constant?

lpil commented 4 years ago

Yes, that would use the same amount of memory and slightly more CPU. In order to keep the amount of memory constant we need to not evaluate the stream to a list.

ericdude4 commented 4 years ago

@lpil yea I assumed so. I actually haven't done a ton of work with the Stream module until now, but it's really cool! The get_recurrences function now returns a stream :)

lpil commented 4 years ago

Wonderful! Thank you for this, it's good to have this in.

I'll release a new version immediately

ericdude4 commented 4 years ago

@lpil do you mind adding the hacktoberfest-accepted label to this pull request?

lpil commented 4 years ago

Does that look right @ericdude4 ?

ericdude4 commented 4 years ago

As far as I can tell; seems they are changing the rules as they go 🤷‍♂️ Thanks!