pyreadr
Reads/writes R RData and Rds files into/from pandas data frames.
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 pyreadruv
uv add pyreadrpoetry
poetry add pyreadrInstalling 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
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
pyreadstatReads and writes SAS, SPSS, and Stata data…
permissive · top 5,000 on PyPI
rdataReads and writes R dataset files (.rda and .rds…
permissive · top 15,000 on PyPI
fastparquetfastparquet reads and writes Apache Parquet…
permissive · top 5,000 on PyPI
gspread-dataframeConverts between Google Sheets worksheets and…
permissive · top 5,000 on PyPI
pandas-read-xmlConverts XML files into pandas DataFrames, with…
permissive · top 15,000 on PyPI
pandavroReads and writes Apache Avro files to and from…
permissive · top 15,000 on PyPI
datacompyDataComPy compares two DataFrames across…
permissive · top 5,000 on PyPI
gspread-pandasBridges Google Sheets and pandas DataFrames,…
permissive · top 15,000 on PyPI
pandas-tdPandas-TD connects pandas DataFrames to…
permissive · top 15,000 on PyPI
awswranglerAWS SDK for pandas integrates pandas DataFrames…
permissive · top 1,000 on PyPI