python interface implementation