I'm looking into how to implement a human-friendly text representation of recurrence rules similar to the toText()
and fromText()
methods of rrule.js; however, I'd like to implement it in Python building on dateutil.rrule.
Testing such methods checking that they are each other's 'inverse', that is, calling one on the result of the other and checking that the result is equivalent to the original input. Which brings me to the question: what does it exactly mean for two rrule
objects to be equivalent?
The latest version of dateutil.rrule
, 2.6.0, does not appear to have an __eq__
method for the rrule
class (see source code). Equivalence also does not seem to be as trivial as equivalence of all attributes, because sometimes a different freq
parameter can still lead to the same recurrences. (For example, freq=DAILY
and freq=WEEKLY
leads to the same recurrence times if byweekday=FR
is chosen; see screen grabs below from the rrule.js demo).
Does anyone know of an implementation of an equivalence relation for rrules? (It doesn't have to be in Python).