
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
pybind11-numpy-example
Advanced tools
A simple example of how to use pybind11 with numpy and publish this as a library on PyPI and conda-forge.
This C++/Python library creates a std::vector
of 16-bit ints,
and provides a Python interface to the contents of this vector in a few different ways:
Python Lists are great! However, when storing many small elements of the same type, a Numpy array is much faster and uses a lot less memory:
The pybind11 code is in src/pybind11_numpy_example_python.cpp.
The python package is defined in pyproject.toml and uses scikit-build-core.
Each tagged commit triggers a GitHub action job which uses cibuildwheel to build and upload a new release including binary wheels for all platforms to PyPI.
The conda-forge package is generated from this recipe, and automatically updates when a new version is uploaded to PyPI.
The scripts used to generate the above plots are in scripts.
This repo was quickly set up using the SSC C++ Project Cookiecutter.
FAQs
An example of using numpy with pybind11
We found that pybind11-numpy-example demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.