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 Table
  • Constructors
  • Examples
  • Attributes
  • Methods

Was this helpful?

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

Table

Work with tables on Redivis

PreviousQuery.to_polars_lazyframeNextTable.add_files

Last updated 4 months ago

Was this helpful?

class Table

Tables are the fundamental data-containing entity in Redivis. Tables belong to either a dataset or workflow, and are made up of rows and variables (columns). Various methods allow you to read table data, as well as to create / update / delete tables belonging to an unreleased version of a dataset.

Certain tables may be , which represent a collection of non-tabular files, where each row corresponds to a file. There are additional methods available on file index tables that allow for you to interface with these files.

Constructors

Returns a list of Tables within a dataset

Returns a list of Tables within a workflow

Examples

dataset = redivis.organization("Demo").dataset("iris_species")
table = dataset.table("Iris")

table.exists() # -> True
table.get() # table.properties is now populated with the table resource definition

table.variable("SepalLengthCm") # -> Returns a variable reference
table.to_pandas_dataframe()     # -> Returns a pandas dataframe for the table
dataset = redivis.organization("Demo").dataset("iris_species")
table = dataset.table("Iris")

table.to_pandas_dataframe()
# 	Id	SepalLengthCm	SepalWidthCm	PetalLengthCm	PetalWidthCm	Species
# 0	33	5.2	        4.1	        1.5	        0.1	        Iris-setosa
# ...

# Other methods to read data:
# table.to_arrow_batch_iterator()
# table.to_arrow_dataset()
# table.to_arrow_table()
# table.to_geopandas_dataframe()
# table.to_dask_dataframe()
# table.to_polars_lazyframe()
dataset = redivis.user("user_or_organization_name").dataset("my dataset")

# Tables can only be created on an unreleased version. 
# If necessary, create a new version:
# dataset = dataset.create_next_version()

dataset.table("my_new_table").create(description="some description")

# Learn more about uploading data in the Upload documentation
upload = table.upload('data.csv').create('/path/to/file')
dataset = redivis.organization("Demo").dataset("iris_species")
table = dataset.table("Iris")

variables = table.list_variables()

for variable in variables:
    print(variable.properties) 

Attributes

dataset

workflow

properties

qualified_reference

For example,

scoped_reference

The canonical reference for the table, without any qualifiers. E.g., posts:7q4m

Methods

Reading data and metadata

Export a table in a particular format and download it to disk.

Download all files represented in a file index table to a local directory.

Check whether the table exists

Fetch table metadata. Once called, the properties attribute on the table will be fully populated.

Deprecated. Please use to_[geo]pandas_dataframe instead.

Uploading and modifying data

Upload non-tabular files to an unreleased file index table.

Create a table within a dataset if it doesn't already exist. Table must belong to an unreleased version of the dataset.

Delete a table belonging to an unreleased version of a dataset.

Return a list of uploads on a table

Update properties on the table (name, description).

(table_reference)

Return a Table within the (either a dataset or workflow). In a Redivis notebook, the default scope will always be the notebook's workflow. If no default scope is specified, the table_reference must be fully qualified (see below). table_reference is a string that identifies the unique table. In some cases this may be the table name, though in others you'll want to include additional information to identify the table and to ensure reproducibility if the table name changes. Consult the documentation to learn more. If you are operating within a Redivis notebook, you can specify "_source_" as the table reference to automatically refer to the notebook's source table.

(table_reference)

Return a Table within a specific . The table_reference does not need to be fully qualified, since the table lookup is already scoped to a dataset. Consult the documentation to learn more.

(table_reference)

Return a Table within a specific . The table_reference does not need to be fully qualified, since the table lookup is already scoped to a workflow.

()

()

A reference to the instance that constructed this table. Will be None if the table belongs to a workflow.

A reference to the instance that constructed this table. Will be None if the table belongs to a dataset.

A dict containing the . This will only be populated after certain methods are called, particularly the get method, and will otherwise be None.

The to this table, for use (e.g.) in a SQL query.

([path, *, format, ...])

([path, *, overwrite, ...])

()

()

([max_results, *, ...])

Return a list of instances in a file index table.

([max_results, *, variables, ...])

Deprecated. Return a list of named tuples referencing the rows of the table. Use to_pydict() instead.

([max_results])

Return a list of instances associated with this table.

([...])

Return an iterator that yields , for processing the table's data in a memory-efficient streaming manner.

([max_results, ...])

Return a for the table. Data is backed by disk, allowing for larger-than-memory analysis.

([max_results, ...])

Return a with the table's data.

([max_results, ...])

([...])

Return a . For working with tables that contain a geography variable.

([max_results, ...])

Return a . Data is backed by disk, allowing for larger-than-memory analysis.

([max_results, ...])

Return a with the table's data.

([max_results])

Return a . Data is backed by disk, allowing for larger-than-memory analysis.

(name)

Reference a within the table.

(*, [files, directory])

([description, ...])

()

([max_results])

()

()

Create a reference to an on the table, which can subsequently be used to upload tabular data.

demo.reddit:prpw:v1_0.posts:7q4m
file index tables
redivis.table
Dataset.table
dataset
referencing resources
Workflow.table
workflow
Dataset.list_tables
Workflow.list_tables
Dataset
Workflow
fully qualified reference
Table.download
Table.download_files
Table.exists
Table.get
Table.list_files
File
Table.list_rows
Table.to_arrow_table().
Table.list_variables
Variable
Table.to_arrow_batch_iterator
pyarrow.RecordBatches
Table.to_arrow_dataset
pyarrow.dataset.Dataset
Table.to_arrow_table
pyarrow.Table
Table.to_dataframe
Table.to_geopandas_dataframe
geopandas.GeoDataframe
Table.to_dask_dataframe
dask.DataFrame
Table.to_pandas_dataframe
pandas.DataFrame
Table.to_polars_lazyframe
polars.LazyFrame
Table.variable
Variable
Table.add_files
Table.create
Table.delete
Table.list_uploads
Table.update
Table.upload
Upload
referencing resources
API resource representation of the table
current default scope