pandas + openpyxl pre-installed), then insert the rows with the zite client. Attach the .xlsx / .csv / .tsv file so the agent can read it while building.
1. Inspect the structure first
Check sheet names, shapes, and headers before mapping, because data often lives on a secondary sheet:$ZITE_UPLOAD_DIR, so cd "$ZITE_UPLOAD_DIR" first, then bare filenames work.
2. Clean, then load into a table
Normalize with pandas, map each row to your table’s SDK field names, and insert withbulkCreate. Pass matchOn so re-imports upsert on a stable key instead of duplicating. For a one-time import over the Zite MCP, run the same bulkCreate call in run_one_off_script; build a workflow like this one when the app itself imports files:
Gotchas
- Check every sheet. Key data is often on a secondary tab.
- Pin dtypes to avoid inference surprises:
pd.read_excel('f.xlsx', dtype={'id': str}). Useheader=Nonewhen there’s no header row,usecols=[...]on wide files. - Handle missing values.
df.isna().sum()finds them; drop or default before loading. - Keep script output under ~20 KB. Summarize with
.head()/.describe()rather than dumping frames. - Map to SDK names.
bulkCreaterecords are keyed by field SDK name from.zite/db.ts, not spreadsheet labels. Up to 100 records per call, so chunk larger files.