DEV Community

Gabriel Fonseca dos Santos
Gabriel Fonseca dos Santos

Posted on AI-assisted

How to catch CSV import problems before they reach your database

CSV files can parse successfully and still be unsafe to import.

Uneven rows, missing fields, inconsistent values, and spreadsheet formula markers can all create problems later in a database, CRM, spreadsheet, or ETL pipeline.

I built Tabular Preflight API to add a validation step before the import happens.

The workflow is simple:

upload → preflight check → decision → import or review

The API analyzes a CSV and returns structured findings, scores, policy.failed, and a conservative safe_to_import verdict.

It does not modify the original CSV.

Example

A CSV containing suspicious spreadsheet formula markers can return:

{
  "safe_to_import": false,
  "policy": {
    "failed": true
  },
  "scores": {
    "structure": 100,
    "completeness": 100,
    "consistency": 100,
    "security": 30,
    "overall": 86
  },
  "findings": [
    {
      "code": "FORMULA_INJECTION_RISK",
      "severity": "critical",
      "dimension": "security",
      "occurrences": 2
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

One important detail: HTTP 200 only means the analysis completed successfully.

It does not mean the CSV is safe to import.

A simple integration rule can look like this:

if not report["safe_to_import"] or report["policy"]["failed"]:
    print("Hold import")
else:
    print("Continue import")
Enter fullscreen mode Exit fullscreen mode

This can be useful for:

  • CSV upload flows
  • ETL pipelines
  • CRM imports
  • admin dashboards
  • data ingestion systems

I’m currently looking for feedback from developers who deal with CSV imports and data pipelines.

Free tier available on RapidAPI:

https://rapidapi.com/gabrielfons35/api/tabular-preflight-api

Top comments (0)