skillfed

rpy2-rinterface

Low-level interface from Python to the R.

rpy2-rinterface v3.6.6 102.1K downloads/30d#12,887 on PyPI702
Copyleft license GPL-2.0-or-later Active released

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-rinterface

uv

uv add rpy2-rinterface

poetry

poetry add rpy2-rinterface

Installing 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

Intended Audience :: DevelopersIntended Audience :: Science/ResearchProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

python r integrationcall r from pythonpython r bridger c api bindingspython r interop
r-integrationc-bindingsscientific-computing

More Scientific/Engineering packages