Python version of reducereaclib [untested]