Python Execution

import() import_main() import_builtins() import_from_path()

Import a Python module

source_python()

Read and evaluate a Python script

repl_python()

Run a Python REPL

eng_python()

A reticulate Engine for Knitr

py_run_string() py_run_file() py_eval()

Run Python code

py

Interact with the Python Main Module

Python Types

dict() py_dict()

Create Python dictionary

tuple()

Create Python tuple

iterate() iter_next()

Traverse a Python iterator or generator

py_iterator()

Create a Python iterator from an R function

with(<python.builtin.object>)

Evaluate an expression within a context.

Python Configuration

py_config()

Python configuration

py_discover_config()

Discover the version of Python to use with reticulate.

py_available() py_numpy_available()

Check if Python is available on this system

py_module_available()

Check if a Python module is available on this system.

use_python() use_virtualenv() use_condaenv()

Configure which version of Python to use

Python Output

py_capture_output()

Capture and return Python output

py_suppress_warnings()

Suppress Python warnings for an expression

Arrays

np_array()

NumPy array

array_reshape()

Reshape an Array

Persistence

py_save_object() py_load_object()

Save and load Python objects with pickle

Low-Level Interface

py_has_attr()

Check if a Python object has an attribute

py_get_attr()

Get an attribute of a Python object

py_set_attr()

Set an attribute of a Python object

py_list_attributes()

List all attributes of a Python object

py_call()

Call a Python callable object

r_to_py() py_to_r()

Convert between Python and R objects

py_is_null_xptr() py_validate_xptr()

Check if a Python object is a null externalptr

py_id()

Unique identifer for Python object

py_len()

Length of Python object

py_str()

An S3 method for getting the string representation of a Python object

py_unicode()

Convert to Python Unicode Object

py_set_seed()

Set Python and NumPy random seeds

py_last_error() py_clear_last_error()

Get or clear the last Python error encountered

py_help()

Documentation for Python Objects

py_func()

Wrap an R function in a Python function with the same signature.

Package Installation

virtualenv_list() virtualenv_root() virtualenv_create() virtualenv_install() virtualenv_remove()

Interface to virtualenv

conda_list() conda_create() conda_remove() conda_install() conda_binary() conda_version()

Interface to conda