C++ wrapper of python c api