c++boost.gif (8819 bytes)
The Boost Python Library (Boost.Python)

Synopsis

Use the Boost Python Library to quickly and easily export a C++ library to Python such that the Python interface is very similar to the C++ interface. It is designed to be minimally intrusive on your C++ design. In most cases, you should not have to alter your C++ classes in any way in order to use them with Boost.Python. The system should simply ``reflect'' your C++ classes and functions into Python. The major features of Boost.Python include support for:

among others.

Supported Platforms

Boost.Python is known to have been tested in the following configurations:

Credits

Table of Contents

  1. A Brief Introduction to writing Python extension modules
  2. Comparisons between Boost.Python and other systems for extending Python
  3. A Simple Example
  4. Exporting Classes
  5. Overridable Virtual Functions
  6. Function Overloading
  7. Inheritance
  8. Special Method and Operator Support
  9. A Peek Under the Hood
  10. Building an Extension Module
  11. Pickle Support
  12. Cross-Extension-Module Dependencies
  13. Wrapping Enums
  14. Pointers and Smart Pointers
  15. Internal Data Structures

Documentation is a major ongoing project; assistance is greatly appreciated! In the meantime, useful examples of every Boost.Python feature should be evident in the regression test files test/comprehensive.[py/hpp/cpp]

Questions should be directed to the boost mailing list.

© Copyright David Abrahams 2001. Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided ``as is'' without express or implied warranty, and with no claim as to its suitability for any purpose.

Updated: Mar 6, 2001