1# Shiboken2-generator
2
3Shiboken is the generator used by the Qt for Python project.
4It outputs C++ code for CPython extensions, which can be compiled
5and transformed into a Python module.
6
7C++ projects based on Qt can be wrapped, but also projects
8which are not related to Qt.
9
10## How does it work?
11
12Shiboken uses an API Extractor that does most of the job,
13but it requires a typesystem (XML file) to customize how the
14C++ classes/methods will be exposed to Python.
15
16The typesystem allows you to remove arguments from signatures,
17modify return types, inject code and add conversion rules
18from the C++ data types to Python data types, manipulate
19the ownership of the objects, etc.
20
21# Examples
22
23An example related to wrap a C++ library not depending on Qt
24can be found in our [repository](https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/samplebinding).
25
26Additionally, you can find a couple of tests inside the
27[git repository](https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/shiboken2/tests).
28
29For a more advanced case regarding extending a Qt/C++ application
30with Python bindings based on the idea of the PySide module,
31you can check the [scriptableapplication](https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/scriptableapplication)
32example in our repository.
33
34# Documentation
35
36You can find more information about Shiboken in our
37[official documentation page](https://doc.qt.io/qtforpython/shiboken2/).
38