Python package dealing with intervals