Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 865 Bytes

File metadata and controls

24 lines (16 loc) · 865 Bytes

Python C++ Extension Example

A Python library with string utility functions implemented in C++, using pybind11 and scikit-build-core.

This is the companion repository for the Build a Python library with a C++ extension tutorial on the Python Developer Tooling Handbook.

Prerequisites

  • uv
  • A C++ compiler (g++, clang++, or MSVC)
  • CMake 3.15 or later

Getting Started

git clone https://github.com/python-developer-tooling-handbook/python-cpp-extension-example.git
cd python-cpp-extension-example
uv sync
uv run python -c "from string_utils import word_count; print(word_count('hello world'))"

License

MIT