Python CFFI Binding around SuiteSparse:GraphBLAS
This is a base package that exposes only the low level CFFI API bindings and symbols. This package is shared by the syntax bindings pygraphblas and python-graphblas.
Pre-built wheels for common platforms are available from PyPI and conda. These bundle a compiled copy of SuiteSparse:GraphBLAS.
pip install suitesparse-graphblasor
conda install -c conda-forge python-suitesparse-graphblasPyPI also has WebAssembly wheels for Pyodide 314 (Python 3.14) and
0.29.4 or later (Python 3.13), the pyemscripten platform of
PEP 783. So, in Pyodide or JupyterLite
(jupyterlite-pyodide-kernel 0.8 uses Pyodide 314):
import micropip
await micropip.install("suitesparse-graphblas")Older versions of Pyodide don't recognize these wheels: micropip says it can't find a pure Python 3 wheel. GraphBLAS runs single-threaded in Pyodide, which has no threads (so no OpenMP).
If you wish to link against your own copy of SuiteSparse:GraphBLAS you may build from source.
Specify the location of your SuiteSparse:GraphBLAS installation in the GraphBLAS_ROOT environment variable then use the standard pip build from source mechanism. This location must contain include/GraphBLAS.h and lib/.
export GraphBLAS_ROOT="/path/to/graphblas"
pip install suitesparse-graphblas-*.tar.gzYou may also have to appropriately set LD_LIBRARY_PATH to find libgraphblas at runtime.
For example, to use Homebrew's SuiteSparse:GraphBLAS on macOS, with the sdist from PyPI, and with all dependencies using wheels:
GraphBLAS_ROOT="$(brew --prefix suitesparse)" pip install --no-binary suitesparse-graphblas suitesparse-graphblas