interval arithmetic libraries

pruebauno at pruebauno at
Mon Jun 8 10:00:08 EDT 2009

On Jun 6, 8:15 am, srepmub <mark.duf... at> wrote:
> Hi all,
> I'm looking for libraries that allow one to calculate with sets of
> (date) intervals. So for example, I'd like to be able to calculate the
> overlap between two sets of intervals, the union etc. Preferrably,
> this works with datetime objects, is written in pure Python, and has
> reasonably good (algorithmic) performance. The neatest library I've
> found so far is this one:
> From an API standpoint, it looks rather nice, but the performance
> could be better (for example, calculating an overlap now involves
> looping quadratically over both interval sets), and it doesn't work
> fully with datetime objects (Inf doesn't work).
> Thanks for any pointers,
> Mark Dufour.
> (author of Shedskin, an experimental (restricted-)Python-to-C++
> compiler,

For some pointers look at this thread where I posted a similar

I am surprised that libraries to do that are not more common. I guess
everybody rolls his own.

More information about the Python-list mailing list