For modern C++ use CLIF (https://github.com/google/clif).
It does not discover your API, you need to describe it in Python terms.
CLIF will recompile your header with the latest LLVM/Clang compiler and produce C++ source code for a Python extension module.
It can understand complex data structures: def f() -> dict>
.