rdata
Read R datasets from Python.
What it is and what it does
rdata is a pure Python library that parses and converts R dataset files (.rda and .rds formats) into native Python objects—primarily pandas DataFrames, numpy arrays, and xarray structures—without requiring R or any R runtime. It also reverses the process, allowing you to write Python data back to R-compatible formats. The library separates parsing (which is deterministic) from conversion (which is customizable), so you can define how specific R classes map to your Python types or use sensible defaults that preserve information.
The package is designed for data scientists and engineers who need to exchange datasets with R workflows, integrate R data into Python pipelines, or work in environments where R cannot be installed (such as web applications using Pyodide). It supports all Python versions from 3.9 onward and depends only on numpy, pandas, xarray, and typing_extensions.
Use it for:
- Load R datasets from repositories or collaborators into pandas DataFrames for analysis in Python.
- Export Python data structures to .rda or .rds files for use in R scripts or sharing with R users.
- Integrate R data into web applications or serverless environments where R runtime is unavailable.
- Define custom conversion rules for R classes that don't map directly to standard Python types.
- Build data pipelines that consume R outputs and produce R inputs without spawning external R processes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads and writes R dataset files (.rda and .rds formats) in pure Python without requiring R or its libraries installed.
Yes. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and solves a specific problem—R↔Python data interchange—without introducing R as a system dependency. Install it if you need to read or write R datasets; skip it if you work exclusively within Python or have R already available and prefer rpy2.
Install
rdata on PyPI
pip
pip install rdatauv
uv add rdatapoetry
poetry add rdataInstalling rdata
Before you install
Low friction installation with a pure Python implementation and no R dependencies. Active maintenance with a recent release 64 days ago and ongoing repository activity.
License in practice
MIT license permits use in any project type—commercial, closed-source, or permissive—without GPL constraints that would apply if R libraries were required.
Quickstart
pip install rdata
import rdata
# Read an R dataset
converted = rdata.read_rds("data.rds")
print(converted)
# Write a pandas DataFrame to R format
import pandas as pd
df = pd.DataFrame({"col": [1, 2, 3]})
rdata.write_rds("output.rds", df)
Requires Python 3.11 or later.
Verify before relying
- Whether custom R class conversion covers the full range of R object types encountered in practice.
- Performance characteristics when handling large or deeply nested R data structures.
- Completeness of round-trip fidelity (R → Python → R) for complex objects.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — numpy, xarray, pandas, typing_extensions |
| Maintenance | actively maintained — 64 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 136,279/month — #11,401 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: rdata-1.1.0-py3-none-any.whl
Keywords: rdata, r, dataset
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pyreadrReads and writes R RData and Rds files directly…
agpl · top 15,000 on PyPI
ucimlrepoImports datasets from the UC Irvine Machine…
permissive · top 15,000 on PyPI
tensorflow-datasetsProvides access to many public datasets as…
permissive · top 5,000 on PyPI
pantabConverts DataFrames to and from Tableau Hyper…
permissive · top 15,000 on PyPI
ir-datasetsProvides a unified Python interface to…
permissive · top 15,000 on PyPI
feather-formatFeather-format provides a Python interface to…
permissive · top 15,000 on PyPI
tfds-nightlyProvides a library of ready-to-use public…
permissive · top 15,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
dataframe-api-compatProvides a lightweight compatibility layer that…
permissive · top 15,000 on PyPI