ccimport
a tiny package for fast python c++ binding build.
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 ccimportuv
uv add ccimportpoetry
poetry add ccimportInstalling 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
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
nanobindnanobind exposes C++ types in Python and vice…
permissive · top 5,000 on PyPI
pccmPCCM manages Python-to-C++ code generation and…
permissive · top 15,000 on PyPI
pybind11-globalA header-only C++ library that generates Python…
permissive · top 15,000 on PyPI
pybind11pybind11 is a header-only C++ library that…
permissive · top 1,000 on PyPI
llvmlitellvmlite provides a lightweight Python binding…
permissive · top 1,000 on PyPI
scikit-buildscikit-build bridges setuptools and CMake to…
permissive · top 5,000 on PyPI
scikit-build-coreA build backend that uses CMake to compile…
permissive · top 5,000 on PyPI
chialisp-builderManages build-time compilation of Chialisp…
unclear · top 15,000 on PyPI
pyexiv2pyexiv2 reads and writes image metadata (EXIF,…
copyleft · top 15,000 on PyPI
chialisp-loaderLoads compiled Chialisp programs (`.hex` files)…
unclear · top 15,000 on PyPI