Development Status
- 5 - Production/Stable
Environment
- Console
- MacOS X
- X11 Applications :: Qt
- Win32 (MS Windows)
Intended Audience
- Developers
Operating System
- MacOS :: MacOS X
- POSIX
- POSIX :: Linux
- Microsoft
- Microsoft :: Windows
Programming Language
- C++
- Python
- Python :: 3
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
- Python :: 3.14
- Python :: 3.15
Topic
- Database
- Software Development
- Software Development :: Code Generators
- Software Development :: Libraries :: Application Frameworks
- Software Development :: User Interfaces
- Software Development :: Widget Sets
Shiboken6-generator
Shiboken is the generator used by the Qt for Python project. It outputs C++ code for CPython extensions, which can be compiled and transformed into a Python module.
C++ projects based on Qt can be wrapped, but also projects which are not related to Qt.
How does it work?
Shiboken uses an API Extractor that does most of the job, but it requires a typesystem (XML file) to customize how the C++ classes/methods will be exposed to Python.
The typesystem allows you to remove arguments from signatures, modify return types, inject code and add conversion rules from the C++ data types to Python data types, manipulate the ownership of the objects, etc.
Examples
For an example related to wrap a C++ library not depending on Qt see the Sample Bindings Example.
Additionally, you can find a couple of tests inside the git repository.
For a more advanced case regarding extending a Qt/C++ application with Python bindings based on the idea of the PySide module, you can check the Scriptable Application Example example.
Documentation
You can find more information about Shiboken in our official documentation page.
Wheel compatibility matrix
| Platform | CPython >=3.10 (abi3) |
|---|---|
| macosx_14_0_universal2 | |
| manylinux_2_34_x86_64 | |
| manylinux_2_39_aarch64 | |
| win_amd64 | |
| win_arm64 |