Several people have created scripts to parse header files and automatically produce Cython bindings.

xdress

XDress is an automatic wrapper generator for C/C++ written in pure Python. Currently, xdress may generate Python bindings (via Cython) for C++ classes & functions and in-memory wrappers for C++ standard library containers (sets, vectors, maps). In the future, other tools and bindings will be supported.

https://s3.amazonaws.com/xdress/index.html

cython-codegen

The is a tool called *cython-codegen* or *xml2cython.py* written by David Cournapeau - download it with git (a version control tool, apt-get install git):

git clone http://github.com/cournape/cython-codegen

It requires gcc_xml and codegenlib from ctypeslib (apt get install python-ctypeslib)

Related information:

fwrap

Automatically generate bindings for fortran files: http://fwrap.sourceforge.net/

cwrap

https://github.com/enthought/cwrap

h2pxd

Script by Evan Buswell http://groups.google.com/group/cython-users/browse_thread/thread/67c3c4443a9c98ca

pxd-gcc-generation

Philip Herron's 2012 GSoC project, using GCC plugins to generate pxd files. Code at

https://github.com/robertwb/cython/tree/pxd-gcc-generation

Requires a recent version of gcc and gcc-python-plugin.

AutoPxd (last edited 2013-04-04 18:53:48 by DagSverreSeljebotn)