patsy

A Python package for describing statistical models and for building design ..

Here are some articles that you may find helpful