The main issue with Boost.Python—and the reason for creating such a similar
project—is Boost. Boost is an enormously large and complex suite of utility
libraries that works with almost every C++ compiler in existence. This
compatibility has its cost: arcane template tricks and workarounds are
necessary to support the oldest and buggiest of compiler specimens. Now that
C++11-compatible compilers are widely available, this heavy machinery has
become an excessively large and unnecessary dependency.
Think of this library as a tiny self-contained version of Boost.Python with everything stripped away that isn't relevant for binding generation. Without comments, the core header files only require ~4K lines of code and depend on Python (2.7 or 3.x, or PyPy2.7 >= 5.7) and the C++ standard library. This compact implementation was possible thanks to some of the new C++11 language features (specifically: tuples, lambda functions and variadic templates). Since its creation, this library has grown beyond Boost.Python in many ways, leading to dramatically simpler binding code in many common situations.
Tutorial and reference documentation is provided at http://pybind11.readthedocs.org/en/master. A PDF version of the manual is available here.
pybind11 alternatives and related libraries
Based on the "Containers" category
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of pybind11 or a related project?
pybind11 RecommendationsThere are no recommendations yet. Be the first to promote pybind11!
Have you used pybind11? Share your experience. Write a short recommendation and pybind11, you and your project will be promoted on Awesome C++.
Recently added pybind11 resources
Be the first to add one!