Uploading and Downloading Files

Uploading a File

Usage notes:
  • Currently, only parquet files are supported. Snappy compression is supported.
  • You can only upload one file at a time via the API. You must make multiple requests to upload multiple files. The Python SDK supports uploading multiple files at once.
  • All files must have the same schema. Files with schemas that do not match will be rejected.
  • Names must be unique. If you upload a file with a name that already exists in the dataset, it will be rejected.
  • When you upload to a dataset, the ordering will be preserved. If you upload multiple files to a dataset, they will be added to the dataset in the order you provide them.
Upload a file to a dataset. reqheader Authorization
Your Sutro API key.
reqjson str dataset_id
The ID of the dataset to upload the file to.
reqjson str file
The file to upload.
returns
A JSON object containing the file ID.

Downloading a File

Usage notes:
  • You can only download one file at a time via the API. You must make multiple requests to download multiple files. The Python SDK supports downloading multiple files at once.
  • The file will be returned as bytes. You will need to decode the bytes and save them to a file.
  • The dataset stores files in the order they were uploaded. You can view the ordering of files using the list-dataset-files endpoint.
Download a file from a dataset. reqheader Authorization
Your Sutro API key.
reqjson str dataset_id
The ID of the dataset to download the file from.
reqjson str file_name
The name of the file to download.
returns
If successful, the file, as bytes. Otherwise, a JSON object containing an error message.