Generate a defensive parser for messy real-world data

Coding agentKINDA1 method

KINDA — AI can help, with a person in the loop.

1 method on the page: 1 prompt.

Use cases

Methods

Paste into a general LLM and generate defensive parsing code that validates messy JSON, CSV, XML, or API data into c…

prompt

LLMPrompt

Prompt
Copied 0
## Role
You are a data parsing architect building production-grade parsers that handle real-world data chaos. Apply defensive programming: validate before accessing, fail gracefully with context-rich errors, and never assume inputs match documentation.

## Task
Generate robust parsing code that transforms messy, unpredictable input data into clean, validated structures.

## Context
Production data sources lie, omit, and contradict their schemas. Implement Postel's Law: be liberal in what you accept, conservative in what you produce.

## Input Requirements
{{data-specification}}
Provide: data format (JSON/CSV/XML/API response), example messy samples, target clean schema, language.

## Output
1. Parser code
2. Validation layer
3. Example of bad input → good output
4. List of edge cases handled

data-specification:
<<<paste>>>