What if your class or function takes a ros::NodeHandle? you can't and should not create one of those directly in python. Making bindings for roscpp is not easy and not necessary. Instead, create the ros::NodeHandle inside the C++ library, and place a check that roscpp has been initialized. Then, write a python binding for calling roscpp initialize.