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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sip-6.16.1.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sip-6.16.1-py3-none-any.whl (3.2 MB view details)

Uploaded Python 3

File details

Details for the file sip-6.16.1.tar.gz.

File metadata

  • Download URL: sip-6.16.1.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for sip-6.16.1.tar.gz
Algorithm Hash digest
SHA256 0a739c9cd2929de4e0884456d8caf3cfb22c10534757c7797bd8dc6bd9ed69bc
MD5 3934e640561d3e9f48f9258ea9d89def
BLAKE2b-256 3cca6b4861723d1bd92d0a21afece74fc63d9bd62fabb1dcc209113972505434

See more details on using hashes here.

File details

Details for the file sip-6.16.1-py3-none-any.whl.

File metadata

  • Download URL: sip-6.16.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for sip-6.16.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2680b2b68f76d391793d7cff0a06967399a38ec2f2ae3074bd3d3a66e316046
MD5 bcc50e13888837c5350cbd677146fc43
BLAKE2b-256 8d9ca4943974dd017756b066815e36b429321a2cfa1e7b74d496b26784df43d1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

6.16.1 This release

2 files

6.16.0

2 files

6.15.3

2 files

6.15.2

2 files

6.15.1

2 files

6.15.0

2 files

6.14.0

2 files

6.13.1

2 files

6.13.0

2 files

6.12.0

2 files

6.11.1

2 files

6.11.0

2 files

6.10.0

2 files

6.9.1

2 files

6.9.0

2 files

6.8.6

2 files

6.8.5

2 files

6.8.4

2 files

6.8.3

2 files

6.8.2

2 files

6.8.1

2 files

6.8.0

2 files

6.7.12

5 files

6.7.11

5 files

6.7.10

4 files

6.7.9

5 files

6.7.8

5 files

6.7.7

5 files

6.7.6

5 files

6.7.5

4 files

6.7.4

4 files

6.7.3

4 files

6.7.2

4 files

6.7.1

4 files

6.7.0

4 files

6.6.2

4 files

6.6.1

5 files

6.6.0

5 files

6.5.1

5 files

6.5.0

4 files

6.4.0

4 files

6.3.1

5 files

6.3.0

5 files

6.2.0

13 files

6.1.1

13 files

6.1.0

13 files

6.0.3

17 files

6.0.2

17 files

6.0.1

13 files

6.0.0

13 files

5.5.0

21 files

5.4.0

21 files

5.3.0

17 files

5.2.0

17 files

5.1.2

17 files

5.1.1

17 files

5.1.0

17 files

5.0.1

17 files

5.0.0

17 files

4.19.8

12 files

4.19.7

12 files

4.19.6

8 files

4.19.5

8 files

4.19.4

8 files

4.19.3

8 files

4.19.2

8 files

4.19.1

8 files

4.19

8 files

4.18.1

4 files

4.18

4 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page