Generating new bindings with PySide generator tools

PySide consists not only of Python Qt bindings, but also of a complete generator toolchain for rapidly generating completely new bindings of your own.

Creating bindings for C++ libraries

If you have a library built on top of Qt or not and want to make it available on Python, then check out the PySide_Binding_Generator page on how to write type system files to export it, generate the source code and build the binaries. Keep in mind that if the wrapped library depends on Qt, then this new binding will depend on PySide as well as on Qt.

If you are interested in experimenting with this, refer to the PySide_Binding_Generator page for a description of the binding generation functionality.

The practical process of generating new bindings is described in PySide_Binding_Generation_Tutorial.

Creating C++ bindings for languages other than Python

It would be possible to adapt the PySide binding generation methodology to generate bindings for any high-level language by adapting the tools in the PySide generation toolchain. PySide_Binding_Generator is a front-end relying on PySide_API_Extractor, which is the tool that does the hard work of parsing the headers, reading the XML descriptions of language adaptations, merging the headers and descriptions together, and delivering processed data about the library to be wrapped for the target language.

To create a new language binding generator, a new generator front-end needs to be written for PySide_API_Extractor. The current PySide_Binding_Generator will be a good starting point.

Categories: