build the python interface