There are at least a couple of packages listed in the Python Package Index which deal with intervals:
interval
pyinterval
I've experimented with interval before and found it to be well-written and documented (at the moment its website seems to be unavailable). I've not used pyinterval.