swig
SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.
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 swiguv
uv add swigpoetry
poetry add swigInstalling 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++
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
tippecanoePackages the tippecanoe command-line tool as a…
permissive · top 15,000 on PyPI
swiglpkswiglpk provides direct Python bindings to the…
copyleft · top 15,000 on PyPI
cmeelcmeel is a PEP 517 build backend that packages…
permissive · top 5,000 on PyPI
oldest-supported-numpyProvides the oldest version of NumPy compatible…
permissive · top 5,000 on PyPI
clangProvides Python bindings to libclang, allowing…
permissive · top 5,000 on PyPI
cmakeDistributes CMake 4.4.2 as a Python package,…
permissive · top 5,000 on PyPI
clang-tidyPackages the clang-tidy C++ linter and related…
permissive · top 15,000 on PyPI
buildBuilds Python packages in isolated…
permissive · top 1,000 on PyPI
scikit-build-coreA build backend that uses CMake to compile…
permissive · top 5,000 on PyPI
pylibfdtProvides Python bindings to libfdt, the device…
unclear · top 15,000 on PyPI