GSOC 2012 Proposal — “Useful tool to help bootstrap of new bindings”

The following is my GSOC2012 proposal and this link will be taken as a addtional info link which anyone who has interest can take a look at and make his comments.



Shiboken is a front-end plugin for Generator Runner which can generate bindings for C++ libraries using CPython source code. But because of complicated language syntax and runtime mechanism of C++, it seems a little difficult for people who use Shiboken very often to create Python bindings, and there are already some complains in the Pyside mailing list. So, it’s very valuable and significant to implement a tool to help bootstrap of new bindings.



This tool would be a command line tool, and when using it, people could inform the header files of libraries which they want to bind, after running, it will generate basic typesystem files for these libraries plus the CMakeFiles for the project.

To let APIExtractor do what we want, we have to modify APIExtractor, because it does the hard work of parsing C++ headers, typesystem XML description files of the binding, and must use these two sets of information that the binding generator may work with. So, an ideal way would be to modify APIExtractor to take a given set of headers and from them produce an intermediate XML description file, which contains the information needed by our tool to generate final binding typesystem files.

However, in the process of modifying work, we can’t avoid dealing with C++, thus it may be not practical for us to do part work of modifying APIExtractor while creating the tool that uses its information at the sametime. So, in this summer project, preliminary work will be modifying APIExtractor first, and writing the command tool second.

The following is the concrete weekly plan:



Week 1: Get the clone of Pyside and Study the whole framework of APIExtractor through reading the source code.

Week 2-Week 8: Modify APIExtractor to do what we want. The detail is:

–Week 2: find the classes through parsing C++ headers

–Week 3: handle namespace-type, interface-type, object-type

–Week 4: extract primitive-type, enum-type,value-type

–Week 5: extract other complex typs like Template

–Week 6: handle C/C++ function and mark them if they need code injection or argument modification or not

–Week 7: can extract all exportable symbols from the given library

–Week 8: write these information to an intermediate XML file

Week 9-Week 12: Create the command tool to help bootstrap of new bindings and do test work

–Week 9: write Python script to offer function of generating new binding typesystem files from the intermediate file created before

–Week 10: write tests against such script

–Week 11: through times testing, check if the previous modifying work on APIExtractor behaves well or not

–Week 12: help improve our command tool in return

Week 13-Week14: perfect the code and documentations, and begin to submit patches

–Week 13: perfect the code and documentations

–Week 14: create patches and try to submit them

Week 15….: summarize the whole work and say goodbye to summer

About me


I’m an undergraduate from China and I’m preparing for my computer science and technology bachelor degree in USTB (University of Science and Technology Beijing). Java and Python is the main programming language when I write programs and software.

During my coding days, I’m getting to know more and more about the Open-Source/FOSS, especially its spirits-share, collaborate, make friends. Every time I find an excellent solution about some problems occurred to me, I become so excited and learned a lot from the process of problems finding-reporting-solving.

I joined gsoc2011 last year and took one Python idea as my summer project, you can take a look at what the project does via python wiki page, and you also can know more through my blog for gsoc:

Contact Info:


# Name: Xu Dehai(You can call me with my English name-higery)

# Blog:

# IRC: higery on

This entry was posted in Python. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s