Simple framework to model mathematical terms, written in python