Hi,
First, thank you for this package! I'm writing some code to handle calendar events as they occur in real time. With python-recurring-ical-events it's really easy for a user to create a recurring calendar event and have an app interacting with their calendar respond to it.
But since I'm working in real time, the "expand everything within a time span" doesn't really work for me, because the time span is constantly moving. My calendar has about 3000 objects, and constantly trying to do this even for just the next day takes on the order of minutes. Of course most of those events are in the past and don't need looking at again, but it isn't very easy to arrange that.
What would be really useful is a "get next event" method, just like what datetime.rrule.rrule.after
provides. It looks like I can hack that by instantiating a RecurringEvent
directly myself, and then accessing the rule
attribute, which would be a dateutil.rrule.rruleset
object. But, I don't think is is a formal part of the python-recurring-ical-events API, and also it would miss any changes in specific instances of the recurring set, such as in #62.
Ideally, UnfoldableCalendar
would have after
and before
methods, just like dateutil.rrule.rrule
, and would return the next or previous event relative to a given time. This would allow an app to follow events in real time. These would probably need to be implemented by considering the rule.after()
(or rule.before()
) against every contained RecurringEvent
, considering any specific instances that override the rule, and doing some sorting. For before
, one would also ideally find the event that ends most recently before the given time.
I thought I'd register this wishlist item and see if you have an opinion. I'm not sure whether to tackle this myself or not, but I wonder if this would be something you'd be willing to accept? It might require some refactoring!
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too