pixeltable icon indicating copy to clipboard operation
pixeltable copied to clipboard

add InsertableTable.insert_file()

Open mkornacker opened this issue 1 year ago • 0 comments

Right now, the only way to insert data is via insert(), which expects an in-memory structure.

insert_file(path: str) -> UpdateStatus would accept a path to a file and insert the data, depending on the file format:

  • json: contains a list of json objects and can be converted to a list of dicts with json.load(); each object must contain the table's column names as fields
  • csv: needs to have a header row, and the column names must correspond to the table's columns

mkornacker avatar Oct 06 '23 18:10 mkornacker