python implementation of the MECS formalism for discrete sites