API List#

List of functions and structures#

A complete list of all functions and structures provided by rdata.

Convenience functions#

Functions that read and write an .rds or .rda file, performing parsing/unparsing and conversion with one line of code.

rdata.read_rds(file_or_path, *[, ...])

Read an RDS file, containing an R object.

rdata.read_rda(file_or_path, *[, ...])

Read an RDA or RDATA file, containing an R object.

rdata.write_rds(path, data, *[, ...])

Write an RDS file.

rdata.write_rda(path, data, *[, ...])

Write an RDA or RDATA file.

Parsing files#

Functions for parsing data in the .rds / .rda format. These functions return a structure representing the contents of the file, without transforming it to more appropriate Python objects. Thus, if a different way of converting R objects to Python objects is needed, it can be done from this structure.

rdata.parser.parse_file(file_or_path, *[, ...])

Parse a R file (.rda or .rdata).

rdata.parser.parse_data(data, *[, ...])

Parse the data of a R file, received as a sequence of bytes.

Unparsing files#

Functions for unparsing data in the .rds / .rda format. These functions do the opposite operation of the parsing functions, that is, they take as an input the rdata’s structure representing the contents of the file, and write it to a file or a bytestring.

rdata.unparser.unparse_file(path, r_data, *)

Unparse RData object to a file.

rdata.unparser.unparse_data(r_data, *[, ...])

Unparse RData object to a bytestring.

Conversion between R and Python objects#

These objects and functions convert the parsed R objects to appropriate Python objects and vice versa. The Python/R objects are chosen to preserve most original properties, but the mappings between objects could change in the future, if more fitting object mappings are found.

rdata.conversion.Converter()

Interface of a class converting R objects in Python objects.

rdata.conversion.SimpleConverter([...])

Class converting R objects to Python objects.

rdata.conversion.convert(data[, ...])

Use the default converter (SimpleConverter()) to convert the data.

rdata.conversion.ConverterFromPythonToR(*[, ...])

Class converting Python objects to R objects.

rdata.conversion.convert_python_to_r_data(data, *)

Convert Python data to R data.

rdata.conversion.convert_python_to_r_object(data, *)

Convert Python data to R object.

Auxiliary structures#

These classes are used to represent R objects which have no clear analog in Python, so that the information therein can be retrieved.

rdata.conversion.RBuiltin(name)

R builtin.

rdata.conversion.RBytecode(code, constants, ...)

R bytecode.

rdata.conversion.RFunction(environment, ...)

R function.

rdata.conversion.REnvironment(*maps[, frame])

R environment.

rdata.conversion.RExpression(elements)

R expression.

rdata.conversion.RExternalPointer(protected, tag)

R bytecode.

rdata.conversion.RLanguage(elements, attributes)

R language construct.

rdata.conversion.SrcFile(filename, ...)

Source file.

rdata.conversion.SrcFileCopy(filename, ...)

Source file with a copy of its lines.

rdata.conversion.SrcRef(first_line, ...)

Reference to a source file location.