Python bindings for C and C++ SDKs
Your SDK is written in C or C++, and more of the people who want to use it write Python. We design and write its Python API, package it for every platform your users run, and hand it over in your repository.
Who asks for it
Python has become the language engineering teams automate with. The requests we see come from four places:
- CAD workflow automation: scripts that open, check, convert and export files in batch
- AI and LLM pipelines that need geometry and metadata as data they can process
- Web services that run the SDK on a server, behind an API
- Engineering startups, most of which build in Python from the first day
Some SDK vendors in CAD data exchange already ship a Python package, and others have one on
their public roadmap. A customer who can pip install your SDK can try it in an
afternoon.
What we deliver
- An API that reads as Python: Python names, exceptions for errors, iterators over collections, context managers for resources that have to be released
- NumPy arrays for bulk data such as points, meshes and transforms, shared with the C++ side where the memory layout allows it
- Bindings in pybind11 or nanobind for C++, or Cython for a C interface
- Type stubs, so editors complete the API and type checkers can verify code written against it
- Tests of the bindings in pytest, run in CI on every platform you support
- Wheels for Linux, Windows and macOS, built in CI and published to PyPI or to your private index
- Documentation with examples that run
Where the difficulty is
Exposing a function takes a few lines. The work is in what happens at the boundary between the two languages, on real files and under real use:
- Ownership. An object created in C++ and held by Python has to be freed exactly once, and a Python handle must not outlive the C++ object it points to.
- Errors. C++ exceptions and error codes become Python exceptions with a message the user can act on, and never cross the boundary unhandled.
- Long calls. A file import that takes minutes releases the interpreter lock, so other Python threads keep running.
- Callbacks. Progress reports and user hooks that call from C++ back into Python.
- Packaging. The SDK's own libraries, and dependencies such as OpenCASCADE, bundled into a wheel that installs on a clean machine.
How it runs
- 1We talk about your SDK What it does, who uses it, and which part of it your users ask for first. We tell you how we would bind it.
- 2Proof of concept, 4 to 6 weeks We choose one module of the SDK together and bind it end to end, from the C++ call to an installable wheel. It validates the architecture before anything larger is decided.
- 3Review, about 2 weeks A joint review of the proof of concept, adjustments, and the full scope and technical choices agreed.
- 4Project The whole SDK covered, with the test suite, CI and CD, packaging for every platform, and documentation. The length depends on the size of the SDK.
- 5Maintenance, if you want it Updates for each SDK release, and changes to the API as your users ask for them.
This order adapts to your constraints. The proof of concept is there so you can judge the approach on your own code at a small cost.
You keep the intellectual property. We work in your repository, under your licence. The bindings, the build and the design of the API belong to you, and so do the decisions about what to expose.
What we have done
A translator on the Datakit SDK in C++17 with Python bindings, shipped as native wheels for Linux and Windows with OpenCASCADE linked in. A NURBS module compiled with Cython, 100× faster than the same evaluation in pure Python. A pure-Python kernel moved onto OpenCASCADE while keeping its Python API.
Start with one module
Tell us which SDK it is, and which part of it your users ask for first. We will propose a proof of concept on that module.