skillfed

swig

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.

swig v4.4.1 1.7M downloads/30d#3,629 on PyPI24
Copyleft license https://github.com/swig/swig/blob/master/LICENSE Active released

What it is and what it does

This package distributes SWIG as a wheel, eliminating the need to install it separately via system package managers. SWIG is a compiler that connects C and C++ programs with high-level languages by automatically generating wrapper code. It's commonly used during the build phase of extension projects to generate bindings from C/C++ interface files.

The package provides pre-compiled binaries for most major platforms and architectures (x86_64, ARM, RISC-V, s390x, and others on Windows, macOS, and Linux). You can declare it in pyproject.toml so it's available during builds, or use it as a command-line tool. With no runtime dependencies, the footprint is minimal once installed.

Use it for:

  • Building C/C++ extensions that need automatic wrapper generation from interface definitions
  • Setting up CI/CD pipelines where the tool must be available without relying on system package managers
  • Declaring the tool as a build-system requirement in pyproject.toml for reproducible builds across platforms
  • Running the tool via pipx without a permanent installation, useful in ephemeral environments like GitHub Actions

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides SWIG as a PyPI-installable package, enabling you to generate language bindings between C/C++ code and Python without requiring a separate system installation.

Yes, if you need this tool for building bindings from C/C++ code. The package eliminates system-level installation friction and works reliably across platforms. Be aware that binary wheels carry GPLv3 licensing obligations—verify compatibility with your project's license before distributing compiled extensions. The package is actively maintained and has no known vulnerabilities.

Install

swig on PyPI

pip

pip install swig

uv

uv add swig

poetry

poetry add swig

Installing swig

Before you install

Medium install friction due to binary wheel distribution across many platforms (Windows, macOS, Linux on x86_64, ARM, and other architectures). Package is actively maintained with recent releases; last commit was 2026-08-13. No runtime dependencies simplifies deployment once installed.

License in practice

Copyleft license (GPLv3 or later) applies to binary wheels due to inclusion of compiled binaries. Source distributions are Apache 2.0. Users distributing compiled extensions must comply with GPLv3 terms; verify compatibility with your project's license before use.

Quickstart

pip install swig

Then add to pyproject.toml:
[build-system]
requires = ["swig"]

Or run directly: swig -python myfile.i

Building from source distribution requires internet access to download source code. Binary wheels are platform-specific; ensure your platform has a matching wheel available.

Verify before relying

  • Whether ARM wheels for Raspberry Pi on piwheels.org are kept in sync with PyPI releases
  • Exact Python version compatibility (requires_python is unspecified in metadata)
  • Whether swig can be used as a direct CLI tool after pip install

Package facts

License https://github.com/swig/swig/blob/master/LICENSE (copyleft)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 230 days since the last release
Last repo commit
First released
Downloads 1,708,972/month — #3,629 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: swig-4.4.1-py3-none-macosx_10_9_universal2.whl; swig-4.4.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; swig-4.4.1-py3-none-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl; swig-4.4.1-py3-none-manylinux2014_s390x.manylinux_2_17_s390x.whl; swig-4.4.1-py3-none-manylinux_2_12_i686.manylinux2010_i686.whl; swig-4.4.1-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl; swig-4.4.1-py3-none-manylinux_2_24_armv7l.manylinux_2_31_armv7l.whl; swig-4.4.1-py3-none-manylinux_2_31_riscv64.whl; swig-4.4.1-py3-none-musllinux_1_2_aarch64.whl; swig-4.4.1-py3-none-musllinux_1_2_armv7l.whl; swig-4.4.1-py3-none-musllinux_1_2_i686.whl; swig-4.4.1-py3-none-musllinux_1_2_ppc64le.whl; swig-4.4.1-py3-none-musllinux_1_2_riscv64.whl; swig-4.4.1-py3-none-musllinux_1_2_s390x.whl; swig-4.4.1-py3-none-musllinux_1_2_x86_64.whl; swig-4.4.1-py3-none-win_amd64.whl; swig-4.4.1-py3-none-win_arm64.whl

Keywords: swig, build, c, c++

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)License :: Other/Proprietary LicenseOperating System :: OS IndependentProgramming Language :: CProgramming Language :: C++Programming Language :: PythonTopic :: Software Development :: Build Tools

Tags

swig python bindingsc++ wrapper generatorlanguage bindings cbuild tool c extensioninterface generator c++
c-bindingsbuild-toolcross-platform

More Build Tools packages