skillfed

pyreadr

Reads/writes R RData and Rds files into/from pandas data frames.

pyreadr v0.5.6 265.5K downloads/30d#8,323 on PyPI339
AGPL license AGPL-3.0-or-later Active released

What it is and what it does

pyreadr is a Python package that reads and writes R's native RData and Rds file formats, converting them to and from pandas DataFrames. It wraps the librdata C library and does not require R to be installed, making it a lightweight bridge between Python data workflows and R data archives. The package supports data frames, tibbles, vectors, matrices, arrays, and tables; R lists and S4 objects are not supported.

The package is built on pre-compiled C extensions and depends only on pandas at runtime. It offers both basic file I/O (read_r, write_rdata, write_rds) and utility functions for inspecting file contents (list_objects) and downloading remote files. Compression options (gzip with configurable levels) are available for writing. The implementation is mature, actively maintained, and widely used in data science workflows that need to interoperate with R-generated datasets.

Use it for:

  • Load R statistical analysis results or datasets into Python pandas for further processing or visualization
  • Convert R data frames from collaborative projects into Python-native format without running R
  • Write Python-generated DataFrames to RData or Rds format for sharing with R users or archival
  • Batch import multiple R data objects from a single RData file into a Python analysis pipeline
  • Stream R data from remote URLs directly into memory without intermediate disk storage

Worth the install?

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

Reads and writes R RData and Rds files directly into pandas DataFrames without requiring R or external dependencies installed.

Yes. pyreadr is actively maintained, has no known vulnerabilities, and solves a specific and common problem—reading R data files in Python without R installed. The AGPL-3.0-or-later license is a consideration for proprietary use, but poses no barrier for open-source or internal projects. Pre-compiled wheels make installation frictionless on standard platforms. Install it if you regularly work with R-generated datasets.

Install

pyreadr on PyPI

pip

pip install pyreadr

uv

uv add pyreadr

poetry

poetry add pyreadr

Installing pyreadr

Before you install

Medium install friction due to compiled C extensions; however, pre-compiled wheels are available for Windows, macOS (x86_64 and ARM64), and Linux (x86_64 and aarch64) across Python 3.10–3.13, making installation straightforward on standard platforms. Maintenance is active with a recent release.

License in practice

Licensed under AGPL-3.0-or-later, which requires that any modifications to the package and derivative works be released under the same license. This is a copyleft license; using it in proprietary software requires careful review of your distribution model.

Quickstart

import pyreadr

result = pyreadr.read_r('data.RData')
df = result['object_name']  # or result[None] for Rds files

# To write:
import pandas as pd
df = pd.DataFrame({'A': [1, 2], 'B': ['a', 'b']})
pyreadr.write_rdata('output.RData', df, df_name='dataset')

Requires a C compiler and zlib, bzip2, lzma libraries to build from source; pre-compiled wheels avoid this for standard platforms.

Verify before relying

  • Whether xarray is truly required only for 3D arrays or if there are other use cases that need it
  • Exact scope of R object types supported beyond data frames, tibbles, vectors, matrices, arrays, and tables
  • Performance characteristics when reading or writing large files

Package facts

License AGPL-3.0-or-later (agpl)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies 1 — pandas
Maintenance actively maintained — 123 days since the last release
Last repo commit
First released
Downloads 265,495/month — #8,323 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyreadr-0.5.6-cp310-cp310-macosx_10_9_x86_64.whl; pyreadr-0.5.6-cp310-cp310-macosx_11_0_arm64.whl; pyreadr-0.5.6-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyreadr-0.5.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyreadr-0.5.6-cp310-cp310-win_amd64.whl; pyreadr-0.5.6-cp311-cp311-macosx_10_9_x86_64.whl; pyreadr-0.5.6-cp311-cp311-macosx_11_0_arm64.whl; pyreadr-0.5.6-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyreadr-0.5.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyreadr-0.5.6-cp311-cp311-win_amd64.whl; pyreadr-0.5.6-cp312-cp312-macosx_10_13_x86_64.whl; pyreadr-0.5.6-cp312-cp312-macosx_11_0_arm64.whl; pyreadr-0.5.6-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyreadr-0.5.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyreadr-0.5.6-cp312-cp312-win_amd64.whl; pyreadr-0.5.6-cp313-cp313-macosx_10_13_x86_64.whl; pyreadr-0.5.6-cp313-cp313-macosx_11_0_arm64.whl; pyreadr-0.5.6-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyreadr-0.5.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyreadr-0.5.6-cp313-cp313-win_amd64.whl

Environment :: ConsoleIntended Audience :: Science/ResearchProgramming Language :: CProgramming Language :: CythonProgramming Language :: PythonTopic :: Scientific/Engineering

Tags

read R data files pythonRData Rds to pandasR file format converterimport R data framesR data serializationlibrdata python wrapperR statistical data import
data-interchanger-integration

More Scientific/Engineering packages