Skip to content
nptmpl @ nguyenpanda.com v1.1.0

cpp/python-c-binding-cmake

Professional high-performance template for creating Python extension modules using the native Python C API (<Python.h>) with CMake. Integrates seamlessly with modern C++ standards and provides a robust Makefile wrapper with 'uv' support. Includes educational examples of complex Python/C++ data exchanges.

Downloads today

0

Total downloads

2

Last updated

2026-05-26

v1.0.0 is latest

Versions

1

0 removed

Download v1.0.0

Clone with the CLI

nptmpl clone http://nptmpl.nguyenpanda.com/api/v1/templates/cpp/python-c-binding-cmake

No @version resolves to the latest release (v1.0.0).

Maintainer nguyenpanda License MIT

Downloads over time

0 in the selected range

Files 14
README.md

Python C/C++ API Professional Template (CMake Version)

A professional template for creating high-performance Python extension modules using the native Python C API (<Python.h>) and CMake.

Features

  • CMake Build System: Industry-standard build system for C/C++ projects.
  • Modern C++: Support for C++20 features.
  • uv Support: High-speed environment management (with fallback to standard Python).
  • Hybrid Examples: Complex C API usage with keyword arguments and sequence processing.

Getting Started

1. Configure Environment

make venv

2. Configure & Build

make configure
make build

3. Run Demonstration

make run

Makefile Targets

Target Description
venv Create virtual environment and install deps
configure Run CMake configuration (uses venv Python)
build Compile the extension module using CMake
run Run main.py
clean Remove CMake build artifacts
reset Remove venv and all build artifacts

Author

nguyenpanda
Email: [email protected]
Website: https://nguyenpanda.com

License

MIT License

Version history

Every release ever published, newest first.

v1.0.0 latest 2 downloads

Published 2026-05-26 08:51:48 by nguyenpanda

Related templates