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

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 BPL. The system should simply “reflect” your C++ classes and functions into Python. The major features of BPL include support for:

among others.

Supported Platforms

BPL has been tested in the following configurations:

Credits

Table of Contents

  1. A Brief Introduction to writing Python extension modules
  2. Comparisons between BPL and other systems for extending Python
  3. A Simple Example Using BPL
  4. Overridable Virtual Functions
  5. Function Overloading
  6. Inheritance
  7. Special Method and Operator Support
  8. A Peek Under the Hood
  9. Building a Module with BPL
  10. Advanced Topics
    1. Pickling
    2. class_builder<>
    3. enums
    4. References
    5. Pointers and Smart Pointers
    6. Built-in Python Types
    7. Other Extension Types
    8. Templates

Documentation is a major ongoing project; assistance is greatly appreciated! In the meantime, useful examples of every BPL 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 2000. 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: Nov 26, 2000