python wrap for ctp