Uploading data

Create a new dataset

import redivis

# Could also create a dataset under an organization:
# dataset = redivis.organization("Demo organization").dataset("some dataset")
dataset = redivis.user("your-username").dataset("some dataset")

# public_access_level can be one of ('none', 'overview', 'metadata', 'sample', 'data')
dataset.create(public_access_level="overview")

Create a table and upload data

import redivis

dataset = redivis.user("user_name").dataset("dataset_name", version="next")

# Create a table on the dataset. Datasets may have multiple tables
table = (
    dataset
    .table("Table name")
    .create(description="Some description")
)

# Upload a file to the table. 
# You can create multiple uploads per table, in which case they'll be appended together.
upload = table.upload("data.csv")

upload = table.upload().create(
        "./data.csv",           # Path to file, data frame, bytes, etc
        type="delimited",       # Inferred from file extension if not provided
        remove_on_fail=True,    # Remove the upload if a failure occurs
        wait_for_finish=True,   # Wait for the upload to finish processing
        raise_on_fail=True      # Raise an error on failure
    )

Upload non-tabular files

Upload data from an external source

Stream data to an upload

Release a new version

Create a subsequent version on an existing dataset

Was this helpful?