skillfed

nanobind

nanobind: tiny and efficient C++/Python bindings

nanobind v2.14.0 4.2M downloads/30d#2,358 on PyPI3,668
Permissive license Active released

What it is and what it does

nanobind is a C++/Python binding library designed to expose C++ types and functions in Python with minimal overhead. It follows syntax similar to Boost.Python and pybind11, making it familiar to developers who have used those tools. The core value proposition is efficiency: the description reports faster compilation times, smaller compiled binaries, and lower runtime performance penalties compared to pybind11 and Cython.

You use nanobind when you need to call C++ code from Python or wrap C++ libraries for Python consumption. It is a build-time tool—you write binding code that nanobind processes to generate Python-callable wrappers around your C++ components. The package itself installs without friction as a pre-built wheel, though actually using it requires a C++ compiler and build environment to compile your bindings.

Use it for:

  • Wrap existing C++ libraries to make them callable from Python without rewriting them
  • Build high-performance Python extensions in C++ where pure Python is too slow
  • Create Python bindings for scientific or numerical C++ code with minimal runtime overhead
  • Integrate C++ game engines, graphics libraries, or real-time systems with Python applications

Worth the install?

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

nanobind exposes C++ types in Python and vice versa, enabling efficient C++/Python bindings with faster compilation, smaller binaries, and lower runtime overhead than comparable tools.

Yes, if you need to bind C++ code to Python. The package is actively maintained, has no known vulnerabilities, installs with low friction, and offers a permissive license. The efficiency claims relative to pybind11 are significant enough to justify trying it for performance-critical bindings, though you should verify those claims match your specific use case.

Install

nanobind on PyPI

pip

pip install nanobind

uv

uv add nanobind

poetry

poetry add nanobind

Installing nanobind

Before you install

Low friction: ships as a pre-built wheel. Actively maintained with a release 7 days ago and 3668 repository stars.

License in practice

Permissive license allows commercial and private use with minimal restrictions.

Quickstart

pip install nanobind==2.14.0

import nanobind as nb
# Use nanobind to wrap C++ code in Python bindings

Requires a C++ compiler and build toolchain to compile C++ code being wrapped; the wheel itself installs without compilation.

Verify before relying

  • Exact performance multipliers (4×, 5×, 10×) claimed in description against pybind11 and Cython—whether these hold across typical use cases
  • Whether nanobind supports all C++ standards and features that pybind11 or Cython cover, or if there are known gaps

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 7 days since the last release
Last repo commit
First released
Downloads 4,225,726/month — #2,358 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: nanobind-2.14.0-py3-none-any.whl

Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: C++Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities

Tags

C++ Python bindingsexpose C++ to Pythonefficient C++ wrapperPython C++ interoplightweight binding libraryC++ type wrappingfast Python C++ bridge
c++-python-interopbinding-generatorperformance-focused

More Python Modules packages