relevanceai.dataset.io.export.csv#

Module Contents#

class relevanceai.dataset.io.export.csv.CSVExport(credentials: relevanceai.client.helpers.Credentials, dataset_id: str, fields: Optional[list] = None, image_fields: Optional[List[str]] = None, audio_fields: Optional[List[str]] = None, text_fields: Optional[List[str]] = None, highlight_fields: Optional[Dict[str, list]] = None, **kwargs)#

A Pandas Like datatset API for interacting with the RelevanceAI python package

to_csv(self, filename: str, **kwargs)#

Download a dataset from Relevance AI to a local .csv file

Parameters
  • filename (str) – path to downloaded .csv file

  • kwargs (Optional) – see client.get_all_documents() for extra args

Example

from relevanceai import Client

client = Client()

dataset_id = "sample_dataset_id"
df = client.Dataset(dataset_id)

csv_fname = "path/to/csv/file.csv"
df.to_csv(csv_fname)