skillfed

ccimport

a tiny package for fast python c++ binding build.

ccimport v0.4.4 182.0K downloads/30d#10,108 on PyPI2
Permissive license MIT DORMANT released

What it is and what it does

ccimport is a lightweight wrapper around pybind11 and ninja that compiles C++ source files into Python-importable modules on demand. Instead of writing a setup.py and running a separate build step, you call ccimport.ccimport() with your C++ source paths, output directory, and build configuration (includes, compiler flags, linker flags), and it handles compilation and loading in one go. It's designed for rapid iteration during development or for embedding C++ code directly in Python scripts without a formal build infrastructure.

The package depends on pybind11 for C++-to-Python binding generation, ninja for fast parallel compilation, requests for potential network operations, and importlib-metadata for runtime package introspection. It requires Python 3.6 or later and a system C++ compiler. With dormant maintenance (last release 668 days ago) but no known vulnerabilities and a stable dependency chain, it remains usable for straightforward binding tasks, though long-term support is uncertain.

Use it for:

  • Rapidly prototype C++ algorithms in Python without writing a full setup.py and build configuration.
  • Embed performance-critical C++ code directly in a Python script for one-off computation or testing.
  • Build Python bindings for existing C++ libraries during development without committing to a formal build system.
  • Automate C++ module compilation in a Python-based build or CI pipeline that needs dynamic compilation.
  • Teach or demonstrate C++ integration with Python in interactive environments without build boilerplate.

Worth the install?

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

ccimport builds Python C++ bindings on-the-fly using pybind11 and ninja, letting you compile and import C++ code directly from Python without separate build steps.

Yes, if you need fast on-demand C++ compilation for Python and are comfortable with dormant maintenance. The low install friction, permissive MIT license, stable dependencies, and zero known vulnerabilities make it safe to use. However, be aware that the last release was 668 days ago; if you encounter issues with newer Python or compiler versions, community support may be limited. Best suited for development workflows or one-off scripts rather than production systems requiring active maintenance.

Install

ccimport on PyPI

pip

pip install ccimport

uv

uv add ccimport

poetry

poetry add ccimport

Installing ccimport

Before you install

Low install friction with a pure-wheel distribution. Dormant maintenance status—last release was 668 days ago—but the repository remains active and the package has no known vulnerabilities. Depends on pybind11, ninja, requests, importlib-metadata, and dataclasses; all are stable, widely-used libraries.

License in practice

MIT license is permissive and poses no restrictions on commercial or private use. You may use, modify, and distribute this package freely as long as you include the license notice.

Quickstart

import ccimport

build_meta = ccimport.BuildMeta()
build_meta.add_global_includes(['/path/to/includes'])
build_meta.add_global_cflags(['-O2'])

lib = ccimport.ccimport(['/path/to/source.cpp'], '/output/path', build_meta)

Requires a C++ compiler (g++, clang, or MSVC) and ninja build tool to be installed and available on your system PATH.

Verify before relying

  • Whether the package works with Python versions beyond 3.10, given the description mentions support only through 3.10.
  • Current state of compatibility with modern pybind11 and ninja versions, given dormant maintenance status.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 5 — pybind11, ninja, requests, importlib-metadata, dataclasses
Maintenance dormant — 668 days since the last release
Last repo commit
First released
Downloads 182,040/month — #10,108 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ccimport-0.4.4-py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

python c++ binding builderfast c++ compilation for pythonpybind11 build automationinline c++ compilationdynamic c++ module loadingpython native extension builderc++ to python binding tool
c++-bindingbuild-automationpybind11

More Build Tools packages