Skip to content

Add a CSV preview endpoint to return column names + first N rows #3

@UrekMaz

Description

@UrekMaz

Add a lightweight endpoint that accepts a small file upload (or raw CSV / URL) and returns a JSON preview containing column names and the first few rows (default N = 5).
This allows the frontend to request a preview after a user uploads a file and populate UI dropdowns (columns/filters).

Suggested files to edit:

process.py — add new route, e.g. POST /process/preview

processing.py — export a small helper or reuse parse_input() to produce preview

(optional) index.html — call preview endpoint to auto-populate column selectors

Acceptance criteria:

New endpoint POST /process/preview exists and accepts the same input options as /process/csv (file, url, or raw_csv)

Response shape:

{
"columns": ["col1", "col2"],
"rows": [
{ "col1": "...", "col2": "..." }
]
}

If an error occurs, endpoint returns a 400 with a structured errors array (consistent with other endpoints)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions