niccokunzmann / python-recurring-ical-events

Python library to calculate recurrence times of events, todos and journals based on icalendar RFC5545

Home Page:https://pypi.org/project/recurring-ical-events/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Select which kinds of components to return

niccokunzmann opened this issue · comments

Before v1.1.0, the library returned only events. Now, it is also returning other component types, see #97.
I am unsure if my code breaks when I update! niccokunzmann/open-web-calendar#136 (yep, not everything is TDD with me :)

I would like to propose a way to

  • by default only return events
  • additionally add components that we also like
events = recurring_ical_events.of(calendar).between(...)
journals = recurring_ical_events.of(calendar, components=["VJOURNAL"]).between(...)
todos = recurring_ical_events.of(calendar, components=["VTODO"]).between(...)
all = recurring_ical_events.of(calendar, components=["VTODO", "VEVENT", "VJOURNAL"]).between(...)

It almost looks like we should do

events = recurring_ical.events.of(calendar).between(...)
todos = recurring_ical.todos.of(calendar).between(...)
journals = recurring_ical.journals.of(calendar).between(...)

But I can see that you might want them all in one place - so this might be not the right design. Renaming the library to recurring_ical_components might also be a nice step.

@tobixen this is interesting to you.

Renaming the library feels a bit like a "nuclear option", not something one would like to do. I have no overview of the consequences of a library rename, but I guess it may be hard to find and hard to use the latest version of the library if one is already using this library.

I think the default should be to return all components.

There are several calendar servers today that supports recurring events, but not recurring tasks. Perhaps some of them are using this library. Perhaps they will magically start returning recurring tasks as well when upgrading the library. Wishful thinking, maybe :-)

But it is nice that the library name matches what it's doing (by default), so ... no further complaints from my side :-)

The fix is shipped in version 2.0.0.

I had completely forgotten about this one, I suppose this explains python-caldav/caldav#241 :-)

Maybe. You seem to fix the version of your dependencies though.