Skip to main content

SIP - A Python Bindings Generator for C and C++ Libraries

One of the features of Python that makes it so powerful is the ability to take existing libraries, written in C or C++, and make them available as Python extension modules. Such extension modules are often called bindings for the library.

SIP is a collection of tools that makes it very easy to create Python bindings for C and C++ libraries. It was originally developed in 1998 to create PyQt, the Python bindings for the Qt toolkit, but can be used to create bindings for any C or C++ library. For example it is also used to generate wxPython, the Python bindings for wxWidgets.

SIP comprises a set of build tools and a sip module. The build tools process a set of .sip specification files and generates C or C++ code which is then compiled to create the bindings extension module. Several extension modules may be installed in the same Python package. Extension modules can be built so that they are are independent of the version of Python being used.

The specification files contain a description of the interface of the C or C++ library, i.e. the classes, methods, functions and variables. The format of a specification file is almost identical to a C or C++ header file, so much so that the easiest way of creating a specification file is to edit a copy of the corresponding header file.

The sip module provides support functions to the automatically generated code. The sip module is installed as part of the same Python package as the generated extension modules. Unlike the extension modules the sip module is specific to a particular version of Python (e.g. v3.9, v3.10, v3.11, v3.12, v3.13).

SIP makes it easy to exploit existing C or C++ libraries in a productive interpretive programming environment. SIP also makes it easy to take a Python application (maybe a prototype) and selectively implement parts of the application (maybe for performance reasons) in C or C++.

MetaSIP is a GUI development for SIP that can take the header files of a C/C++ library into a project from which API items can be managed, compared with new versions etc. and from which the .sip specification files can be generated from.

Documentation

The documentation can be found at Read the Docs.

License

SIP is licensed under the BSD 2 clause license.

SIP includes a copy of ply which is licensed under the BSD 3 clause license.

Installation

To install SIP, run:

pip install sip

Creating Packages for Distribution

Python sdists and wheels can be created with any standard Python build frontend.

For example, using build an sdist and wheel will be created from a checkout in the current directory by running:

python -m build --outdir .

Building the Documentation

The documentation is built using Sphinx, myst_parser and the sphinx-rtd-theme theme.

Change to the docs directory of a checkout and run:

make html

The HTML documentation can then be found in the _build/html subdirectory.

Metadata

Release files for sip 6.17.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sip 6.17.3
File Size Uploaded Provenance Actions
sip-6.17.3.tar.gz 3.2 MB Without provenance Details for sip-6.17.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sip 6.17.3
File Interpreter ABI Platform Actions
sip-6.17.3-py3-none-any.whl Python 3 none any Details for sip-6.17.3-py3-none-any.whl

Total release size: 6.6 MB

Release files / sip-6.17.3.tar.gz

Download URL sip-6.17.3.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
e3b5c2d1429a96f2e1fc25b69d4ceb232bc8b7f2395e864c904cec28905642b5
BLAKE2b-256 checksum
How to use checksums
cd656bfe13637ee9adfc07c4ee8501aa3e4e2f0555e6163a6cba80f70698a0a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Release files / sip-6.17.3-py3-none-any.whl

Download URL sip-6.17.3-py3-none-any.whl
Size 3.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6a29643f93415c21c6175c7fda86034fdc215736bea283eea3dc732eb036efe4
BLAKE2b-256 checksum
How to use checksums
e2d96069bdd7be065166ce0b24f386b1f056a97aa39b4d4261fcd91ebe31f308
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Security for sip 6.17.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

6.17.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page