Package 'redivis'

Title: R interface for Redivis
Description: Supports working with Redivis API through R. Parse metadata, execute queries, and load data into R.
Authors: Redivis Inc. [aut, cre, cph]
Maintainer: Redivis Inc. <[email protected]>
License: MIT + file LICENSE
Version: 0.13.1
Built: 2026-10-13 03:45:22 UTC
Source: https://github.com/redivis/redivis-r

Help Index


current_notebook

Description

DEPRECATED: please use redivis$current_notebook

Usage

current_notebook()

Value

class<Notebook>

Examples

## Not run: 
redivis::current_notebook()$create_output_table(df)

## End(Not run)

Open a connection to a Redivis file

Description

Makes open(file) behave like file$open(), returning a read-only connection backed by HTTP range requests.

Usage

## S3 method for class 'File'
open(con, mode = "r", ...)

Arguments

con

A Redivis File object

mode

Character string. "r" (default) for text mode, "rb" for binary mode.

...

Ignored (present for compatibility with the generic)

Value

A readable connection backed by HTTP range requests


organization

Description

DEPRECATED: please use redivis$organization

Usage

organization(name)

Arguments

name

The organization's username

Value

class<user>

Examples

## Not run: 
redivis::organization('demo_organization')$dataset('some_dataset')$table('a_table')$to_tibble(max_results=100)

# We can also construct a query scoped to a particular dataset, removing the need to fully qualify table names
redivis::organization('demo_organization')$dataset('some_dataset')$query("SELECT * FROM table_1 INNER JOIN table_2 ON id")$to_tibble()

## End(Not run)

query

Description

DEPRECATED: please use redivis$query

Usage

query(query = "", default_workflow = NULL, default_dataset = NULL)

Arguments

query

The query string to execute

default_workflow

Optional workflow reference used to resolve unqualified table references. Defaults to the REDIVIS_DEFAULT_WORKFLOW environment variable.

default_dataset

Optional dataset reference used to resolve unqualified table references. Defaults to the REDIVIS_DEFAULT_DATASET environment variable.

Value

class<Query>

Examples

## Not run: 
output_table <- redivis::query(query = 'SELECT 1 + 1 AS two')$to_tibble()

## End(Not run)

redivis

Description

Redivis wrapper, all primary constructor accessible via redivis$<constructor>()

Full documentation and examples available at: https://apidocs.redivis.com/client-libraries/redivis-r

Usage

redivis

Format

An object of class environment of length 17.

Value

list(authenticate, current_notebook, current_user, current_workflow, dataset, datasource, file, make_api_request, notebook, organization, parameter, query, table, transform, user, workflow)

Overview

library(redivis)

# Reference various resources
redivis$current_user()
redivis$dataset(name)
redivis$datasource(source)
redivis$notebook(name)
redivis$organization(name)
redivis$parameter(name)
redivis$table(name)
redivis$transform(name)
redivis$user(name)
redivis$workflow(name)

# Create a SQL query
redivis$query(query)

# Only available within Redivis notebooks
redivis$current_notebook()
redivis$current_workflow()
user$secret("MY_SECRET")$get_value()
organization$secret("OUR_SECRET")$get_value()

# Read data
query$to_tibble()
table$to_tibble()
# also:
#   to_data_table()
#   to_arrow_table()
#   to_arrow_batch_iterator()
#   to_sf_tibble()
#   ...
table$download(path=NULL, format="csv", ...)

# DBI interface
con <- redivis$connect_dbi()

# Read files (file tables only):
table$file("path/to/file")
open(file)
file$read(...)
file$download(path=NULL, ...)
dir <- table$to_directory()
dir$get("/path/to/file/or/dir")
dir$download(path=NULL, ...)

# Upload data
table$upload()$create("/path/to/file.csv", ...)
# Upload raw files
table$add_files(directory="/path/to/dir", ...)

# List resources
organization$list_datasets(max_results)
user$list_datasets(max_results)
user$list_workflows(max_results)
dataset$list_tables(max_results)
workflow$list_tables(max_results, include_datasources=FALSE)
workflow$list_transforms(max_results)
table$list_variables(max_results)
#...etc, see documentation

# Miscellaneous methods, for advanced use cases
redivis$authenticate(scope=NULL, force_reauthentication=FALSE)
redivis$make_api_request(method="GET", path, ...)

Examples

## Not run: 
 df <- redivis$table("demo.ghcn_daily_weather_data.stations")$to_tibble()
 df <- redivis$query("SELECT 1+1 as two")$to_tibble()

 redivis$dataset("demo.ghcn_daily_weather_data")$exists() # TRUE
 datasets <- redivis$organization("demo")$list_datasets(max_results=10)
 workflows <- redivis$current_user()$list_workflows(10)

 # Only callable from within a Redivis notebook
 notebook <- redivis$current_notebook();
 workflow <- redivis$current_workflow();

## End(Not run)

Create a Redivis DBI driver

Description

Create a Redivis DBI driver

Usage

RedivisDBI()

Value

A RedivisDriver object


user

Description

DEPRECATED: please use redivis$user

Usage

user(name)

Arguments

name

The user's username

Value

class<user>

Examples

## Not run: 
redivis::user('my_username')$workflow('my_workflow')$table('my_table')$to_tibble(max_results=100)

# We can also construct a query scoped to a particular workflow, removing the need to fully qualify table names
redivis::user('my_username')$workflow('my_workflow')$query("SELECT * FROM table_1 INNER JOIN table_2 ON id")$to_tibble()

## End(Not run)