--- id: rdata version: "1.1.0" license: MIT license_treatment: permissive maintenance: active --- # rdata — Read R datasets from Python. License: permissive · Maintenance: active · Downloads: 136.3K/mo ## 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 above — 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 pip install rdata uv add rdata 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_current - Install friction: low - Maintenance: active - Downloads: 136.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags read R datasets python, rda rds file parser, R data format conversion, import R data files, R object serialization python, cross-language data interchange, R compatibility layer, data-interchange, r-integration, file-format [View on SkillFed](https://skillfed.io/packages/rdata) · [View on PyPI](https://pypi.org/project/rdata/)