Redivis API
User documentationredivis.com
  • Introduction
  • Referencing resources
  • Client libraries
    • redivis-js
      • Getting started
      • Examples
    • redivis-python
      • Getting started
      • Reference
        • redivis
          • redivis.current_notebook
          • redivis.file
          • redivis.organization
          • redivis.query
          • redivis.table
          • redivis.user
        • Dataset
          • Dataset.add_labels
          • Dataset.create
          • Dataset.create_next_version
          • Dataset.delete
          • Dataset.exists
          • Dataset.get
          • Dataset.list_tables
          • Dataset.list_versions
          • Dataset.query
          • Dataset.release
          • Dataset.remove_labels
          • Dataset.table
          • Dataset.unrelease
          • Dataset.update
          • Dataset.version
        • File
          • File.download
          • File.get
          • File.read
          • File.stream
        • Member
          • Member.add_labels
          • Member.exists
          • Member.get
          • Member.remove_labels
          • Member.update
        • Notebook
          • Notebook.create_output_table
        • Organization
          • Organization.dataset
          • Organization.list_datasets
          • Organization.list_members
          • Organization.member
        • Query
          • Query.download_files
          • Query.get
          • Query.list_files
          • Query.list_rows
          • Query.to_arrow_batch_iterator
          • Query.to_arrow_dataset
          • Query.to_arrow_table
          • Query.to_dataframe
          • Query.to_geopandas_dataframe
          • Query.to_dask_dataframe
          • Query.to_pandas_dataframe
          • Query.to_polars_lazyframe
        • Table
          • Table.add_files
          • Table.create
          • Table.delete
          • Table.download
          • Table.download_files
          • Table.get
          • Table.exists
          • Table.list_files
          • Table.list_rows
          • Table.list_uploads
          • Table.list_variables
          • Table.to_arrow_batch_iterator
          • Table.to_arrow_dataset
          • Table.to_arrow_table
          • Table.to_dataframe
          • Table.to_geopandas_dataframe
          • Table.to_dask_dataframe
          • Table.to_pandas_dataframe
          • Table.to_polars_lazyframe
          • Table.update
          • Table.upload
          • Table.variable
        • Upload
          • Upload.create
          • Upload.delete
          • Upload.exists
          • Upload.get
          • Upload.insert_rows
          • Upload.list_variables
          • Upload.to_*
        • Version
          • Version.dataset
          • Version.delete
          • Version.exists
          • Version.get
          • Version.previous_version
          • Version.next_version
        • User
          • User.dataset
          • User.list_datasets
          • User.workflow
          • User.list_workflows
        • Variable
          • Variable.get
          • Variable.exists
          • Variable.update
        • Workflow
          • Workflow.get
          • Workflow.exists
          • Workflow.list_tables
          • Workflow.query
          • Workflow.table
      • Examples
        • Listing resources
        • Querying data
        • Reading tabular data
        • Uploading data
        • Working with non-tabular files
    • redivis-r
      • Getting started
      • Reference
        • redivis
          • redivis$current_notebook
          • redivis$file
          • redivis$organization
          • redivis$query
          • redivis$table
          • redivis$user
        • Dataset
          • Dataset$create
          • Dataset$create_next_version
          • Dataset$delete
          • Dataset$exists
          • Dataset$get
          • Dataset$list_tables
          • Dataset$query
          • Dataset$release
          • Dataset$table
          • Dataset$unrelease
          • Dataset$update
        • File
          • File$download
          • File$get
          • File$read
          • File$stream
        • Notebook
          • Notebook$create_output_table
        • Organization
          • Organization$dataset
          • Organization$list_datasets
        • Query
          • Query$download_files
          • Query$get
          • Query$list_files
          • Query$to_arrow_batch_reader
          • Query$to_arrow_dataset
          • Query$to_arrow_table
          • Query$to_data_frame
          • Query$to_data_table
          • Query$to_tibble
          • Query$to_sf_tibble
        • Table
          • Table$add_files
          • Table$create
          • Table$delete
          • Table$download
          • Table$download_files
          • Table$get
          • Table$exists
          • Table$list_files
          • Table$list_uploads
          • Table$list_variables
          • Table$to_arrow_batch_reader
          • Table$to_arrow_dataset
          • Table$to_arrow_table
          • Table$to_data_frame
          • Table$to_data_table
          • Table$to_tibble
          • Table$to_sf_tibble
          • Table$update
          • Table$upload
          • Table$variable
        • Upload
          • Upload$create
          • Upload$delete
          • Upload$exists
          • Upload$get
          • Upload$insert_rows
          • Upload$list_variables
          • Upload$to_*
        • User
          • User$dataset
          • User$list_datasets
          • User$workflow
          • User$list_workflows
        • Variable
          • Variable$get
          • Variable$exists
          • Variable$update
        • Workflow
          • Workflow$get
          • Workflow$exists
          • Workflow$list_tables
          • Workflow$query
          • Workflow$table
      • Examples
        • Listing resources
        • Querying data
        • Reading tabular data
        • Uploading data
        • Working with non-tabular data
  • REST API
    • General structure
    • Authorization
    • Access
      • get
      • list
    • Datasets
      • delete
      • get
      • list
      • patch
      • post
    • Exports
      • download
      • get
      • post
    • Files
      • createSignedUrl
      • get
      • head
      • post
    • Members
      • get
      • list
    • Queries
      • get
      • post
      • listRows
    • ReadSessions
      • post
      • getStream
    • Tables
      • createTempUploads
      • delete
      • get
      • list
      • listRows
      • patch
      • post
    • Uploads
      • delete
      • get
      • insertRows
      • list
      • listRows
      • post
    • Variables
      • get
      • list
      • patch
    • Versions
      • delete
      • get
      • list
      • post
      • release
      • unrelease
    • Workflows
      • get
      • list
  • Resource definitions
    • Access
    • Dataset
    • Export
    • Member
    • Organization
    • Query
    • Table
    • Upload
    • User
    • Variable
    • Version
    • Workflow
Powered by GitBook
On this page
  • class File
  • Constructors
  • Examples
  • Fields
  • Methods

Was this helpful?

  1. Client libraries
  2. redivis-r
  3. Reference

File

class File

An interface for working with files on Redivis. When the constructor is called directly, a file_id must be provided. Also returned by listing files associated with a particular table or query result.

Constructors

List files contained within a query result. The query result must contain at least one file_id variable.

Construct a reference to a file based on its globally unique id.

List files contained within a file index table. The table must contain at least one file_id variable.

Examples

loadNamespace("redivis")

f = redivis$file("4c10-d8rqhswh8.zz7AB9NJB2ctNpDGKbRD7w")

f$download() # download to current working directory
f$download("new_name.tiff") # download to current working directory, and rename to new_name.tiff
f$download("/some/path/") # downloaded as /some/path/bogota.tiff
f$download("/some/path/new_name.tiff") # downloaded as /some/path/new_name.tiff

print(f$properties) 
# $kind
# [1] "rawFile"

# $id
# [1] "4c10-d8rqhswh8.zz7AB9NJB2ctNpDGKbRD7w"

# $uri
# [1] "/rawFiles/4c10-d8rqhswh8.zz7AB9NJB2ctNpDGKbRD7w"

# $name
# [1] "bogota.tiff"

# $contentType
# [1] "image/tiff"

# $md5
# [1] "3Kxlyg=="

# $size
# [1] 253896
loadNamespace("redivis")

f = redivis$file("4c10-bk27tqmet.rkgXgUlmnJrEFFC6oWAqqA")

file_content_string = f$read(as_text=TRUE)
loadNamespace("redivis")

f = redivis$file("rnwk-acs3famee.pVr4Gzq54L3S9pblMZTs5Q")

# Stream a file
data <- f$stream(function(x) {
  print(length(x))
})

Fields

id

The globally unique identifier for the file, as a string.

query

properties

A dict containing information about the file.

  • id str: The globally unique id of the file

  • name str: The name of the file, including any extensions

  • size int: The size of the file, in bytes

  • contentType str: The MIME type associated with the file's extension, when available

  • md5 str: The md5 checksum of the file, as a base64 string

table

Methods

Download the file.

Get file metadata, after which file$properties will be fully populated.

Read the file contents into memory, either as raw bytes (the default) or as a string if as_text=True.

Read the file in a streaming manner, repeatedly calling the callback function with the latest chunk of bytes.

PreviousDataset$updateNextFile$download

Last updated 2 months ago

Was this helpful?

([max_results, *, ...])

(file_id)

([max_results, *, ...])

A reference to the query from which this file was loaded from. Will only be populated if constructed via

This will be fully populated after calling , containing the following properties:

A reference to the table from which this file was loaded from. Will only be populated if constructed via .

(path[, ...])

()

(as_text)

(callback)

query$list_files
redivis$file
table$list_files
Query.list_files
File.get()
Table.list_files
file$download
file$get
file$read
file$stream