My mean reversion algorithm occasionally incurs heavy losses due to structural changes in time series. I am looking for python libraries that can detect structural changes in a time series. I know R has a package strucchange. Does anyone know of a good Python library to detect structural shifts in mean of a series?