Search code examples
c++pythonpython-embedding

Looking for non-Boost::Python C++ Python embedding framework


I have a project of mine, written in C++, that has now progressed to a stage where I require an embedded programming language. I've chosen Python for several reasons, and have been playing around with revealing an API to a dynamically-loaded Python module. It works well, and I think I will stick with Python for the foreseeable future.

I have a question, though. I've been spending a lot of time adding each function to the Python API that I'm providing, and so I've been looking for a framework that alleviates much of the repetition.

The framework that seems to be mentioned time and time again is Boost::Python. While I have nothing against Boost::Python -- in fact I will probably use it in the near future -- for this project I unfortunately cannot use Boost-related libraries.

Are there any other decent frameworks out there? I don't particularly fancy writing my own, but neither do I wish to continue my use of the straight Python C API.

Thanks!


Solution

  • I was facing nearly the same problem but at the end I sticked Boost::Python ;) However an option to Boost::Python is Swig. If you use Swig you also, don't have to write so much boilerplate code than you have to with Boost::Python.