PyBindGen is a Python bindings generator tool.
PyBindGen is a Python module that is geared to generating C/C++ code that binds a C/C++ library for Python. It does so without extensive use of either C++ templates or C pre-processor macros. It has modular handling of C/C++ types, and can be easily extended with Python plugins. The generated code is almost as clean as what a human programmer would write.
PyBindGen is a Python module that generates Python bindings for C or C++ APIs. It was designed to be an alternative to some other bindings generators out there, including:
· Boost::Python, which uses C++ templates extensively, which are difficult to understand or extend, and which generates relatively large Python modules;
· SWIG, which makes extensive use of macros, generates very ugly code, and is itself written in C++, therefore difficult to extend;
· Python SIP, which is also written in C++;
· The PyGtk code generator, which doesn't support wrapping C++ code, and is not very flexible;
Here are some key features of "PyBindGen":
· Is written in clean, PEP 8 compliant, and pylint checked, Python code;
· Generates clean C or C++ code, nearly as readable as code written manually by a developer;
· Generated code does not require any external libraries or macros;
· Does not require Boost.Python (no C++ template magic, also works in C);
· The main interface for code generation is a simple Python API, not some obscure interface definition language. Other frontends, such as parsing header files with gccxml, could be added in the future as an additional layer;
· Can be easily extended with new type handlers;
· Type handlers can allocate memory and register cleanup code to free;
· Supports in, out, and inout parameters (e.g. with pointers or C++ references);
· Supports multiple return values (e.g. due to out/inout parameters);
· Supports wrapping of simple C++ classes;
· Supports virtual methods in classes;
· Supports reference counted classes and smart pointers.
Requirements:
· Python
Product's homepage
Here are some key features of "PyBindGen":
· Is written in clean, PEP 8 compliant, and pylint checked, Python code;
· Generates clean C or C code, nearly as readable as code written manually by a developer;
· Generated code does not require any external libraries or macros;
· Does not require Boost.Python (no C template magic, also works in C);
· The main interface for code generation is a simple Python API, not some obscure interface definition language. Other frontends, such as parsing header files with gccxml, could be added in the future as an additional layer;
· Can be easily extended with new type handlers;
· Type handlers can allocate memory and register cleanup code to free;
· Supports in, out, and inout parameters (e.g. with pointers or C references);
· Supports multiple return values (e.g. due to out/inout parameters);
· Supports wrapping of simple C classes;
· Supports virtual methods in classes;
· Supports reference counted classes and smart pointers.
Requirements:
· Python
What's New in This Release: [ read full changelog ]
· PyBindGen 0.14.1 released, containing a few bug fixes, most notably related to multiple inheritance.