Export data for analytics

Export Pixeltable tables and queries to CSV, JSON, and Apache Iceberg for spreadsheets, scripts, and the lakehouse.

Data Import/Export · Notebook · Updated

Colab runs it in your browser. If it calls a model provider, it asks for that provider's API key in a cell.

How it works

Pixeltable's export helpers live in the pxt.io module, one function per destination. Here's how each handles the three factors above:

export_iceberg() streams into an Apache Iceberg catalog you supply; the other two write a single file.

What it covers

  • Export a table or filtered query to CSV, JSON, and Apache Iceberg
  • Keep media references portable instead of writing local file paths
  • Use advanced Iceberg options for existing tables, embeddings, and type overrides

What it uses

Install
terminal
pip install pixeltable pyiceberg
Pixeltable calls
pxt.create_table()insert()add_computed_column()

A look at the code

data-export-analytics.ipynb
images.add_computed_column(width=pxtf.image.width(images.image))
images.add_computed_column(height=pxtf.image.height(images.image))
images.add_computed_column(mode=pxtf.image.mode(images.image))
# The derived columns we'll export
features = images.select(
images.label, images.width, images.height, images.mode
)
features.collect()

One cell of the notebook, copied as it is. Open it in Colab for the rest.

Browse all 103