rpy2-rinterface
Low-level interface from Python to the R.
What it is and what it does
rpy2-rinterface is the foundational C-level binding layer for the rpy2 project, exposing R's C API directly to Python. It handles the low-level mechanics of calling R functions, managing R objects in memory, and translating between Python and R data types at the C boundary. This is a namespace package component—typically installed as part of the larger rpy2 ecosystem rather than used standalone—and requires both Python (3.9 or later) and a working R installation on your system.
The package depends on cffi and packaging for its build and runtime. Installation involves either downloading pre-built wheels for supported platforms (macOS and Windows across Python 3.9–3.14) or compiling from source, which demands a C compiler and R development headers. Once installed, it serves as the engine behind higher-level rpy2 modules that provide more Pythonic interfaces to R.
Use it for:
- Building a Python application that needs to call R statistical functions or libraries directly.
- Integrating R computations into a data pipeline written primarily in Python.
- Developing higher-level Python bindings or wrappers around R packages.
- Running R code from within a Python Jupyter notebook or interactive environment.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
rpy2-rinterface provides a low-level Python-to-R bridge, exposing R's C API through Python bindings so you can call R functions and work with R objects from Python code.
Yes, if you need Python-R interoperability and are willing to manage the system dependencies (R installation, C compiler for source builds). The package is actively maintained, has no known vulnerabilities, and supports current Python versions. The GPL-2.0-or-later license is a constraint for proprietary use. Install friction is moderate but manageable on standard development systems.
Install
rpy2-rinterface on PyPI
pip
pip install rpy2-rinterfaceuv
uv add rpy2-rinterfacepoetry
poetry add rpy2-rinterfaceInstalling rpy2-rinterface
Before you install
Medium install friction: requires a compilation toolchain and R to be installed on your system. Binary wheels are provided for Python 3.9–3.14 on macOS and Windows, but building from source demands developer tools. The package is actively maintained with recent releases.
License in practice
Licensed under GPL-2.0-or-later (copyleft). Any code linking rpy2-rinterface must comply with GPL v2 or later terms—proprietary projects may face licensing constraints.
Quickstart
import rpy2.rinterface as ri
ri.initr()
# Call R functions via the low-level interface
R must be installed and discoverable on your system; if R is not in a standard location, you may need to set LD_LIBRARY_PATH before importing.
Verify before relying
- Whether the package works on Linux (wheels are listed only for macOS and Windows in the friction evidence).
- Specific performance characteristics or memory overhead of the C API binding layer.
Package facts
| License | GPL-2.0-or-later (copyleft) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — cffi, packaging |
| Maintenance | actively maintained — 140 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 102,136/month — #12,887 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: rpy2_rinterface-3.6.6-cp310-cp310-macosx_10_9_universal2.whl; rpy2_rinterface-3.6.6-cp310-cp310-win_amd64.whl; rpy2_rinterface-3.6.6-cp311-cp311-macosx_10_9_universal2.whl; rpy2_rinterface-3.6.6-cp311-cp311-win_amd64.whl; rpy2_rinterface-3.6.6-cp312-cp312-macosx_10_13_universal2.whl; rpy2_rinterface-3.6.6-cp312-cp312-win_amd64.whl; rpy2_rinterface-3.6.6-cp313-cp313-macosx_10_13_universal2.whl; rpy2_rinterface-3.6.6-cp313-cp313-win_amd64.whl; rpy2_rinterface-3.6.6-cp314-cp314-macosx_10_15_universal2.whl; rpy2_rinterface-3.6.6-cp314-cp314-win_amd64.whl; rpy2_rinterface-3.6.6-cp39-cp39-macosx_10_9_universal2.whl; rpy2_rinterface-3.6.6-cp39-cp39-win_amd64.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
rpy2rpy2 embeds R within Python, allowing you to…
copyleft · top 15,000 on PyPI
rpy2-robjectsProvides a Python interface to call R code and…
copyleft · top 15,000 on PyPI
cwrapcwrap is a Python wrapper around C code that…
copyleft · top 15,000 on PyPI
pyobjc-corePyObjC-core provides the foundational bridge…
permissive · top 5,000 on PyPI
mpi4pympi4py provides Python bindings for the Message…
permissive · top 5,000 on PyPI
pyobjcPyObjC bridges Python and Objective-C, enabling…
permissive · top 15,000 on PyPI
httpx-aiohttpProvides aiohttp-based transports for httpx,…
unclear · top 5,000 on PyPI
princePrince implements multivariate exploratory data…
permissive · top 15,000 on PyPI
mautrixAn asyncio Matrix framework for Python that…
copyleft · top 5,000 on PyPI
pyqirPyQIR generates, parses, and analyzes QIR…
permissive · top 15,000 on PyPI