skillfed

rdata

Read R datasets from Python.

rdata v1.1.0 136.3K downloads/30d#11,401 on PyPI60
Permissive license MIT Active released

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 rdata

uv

uv add rdata

poetry

poetry add rdata

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: File FormatsTopic :: Scientific/Engineering :: MathematicsTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

read R datasets pythonrda rds file parserR data format conversionimport R data filesR object serialization pythoncross-language data interchangeR compatibility layer
data-interchanger-integrationfile-format

More Python Modules packages