cd /news/developer-tools/csv-export-investigation-evidence-wo… · home › topics › developer-tools › article
[ARTICLE · art-152012] src=gist.github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

CSV export investigation: evidence worksheet and reproducible Python fixtures

A developer published a standalone Python script and JSON worksheet for investigating CSV export behavior in software they own or are authorized to examine. The script generates 36 input strings covering commas, quotes, newlines, Unicode, and empty strings, then writes inputs.json and a reference.csv using UTF-8 without a BOM, comma delimiters, CRLF endings, and minimal double-quote escaping, verifying that Python's CSV reader restores all 36 rows. The author notes the dialect is an explicit example specification, not a claim about any application's actual exporter, and that static inspection cannot establish that a branch ran in a particular session.

by read3 min views2 publishedOct 17, 2026

A small, standalone resource for developers who are inspecting an export feature in software they own or have permission to examine. The included Python script creates 36 combinations of ordinary text, commas, quotation marks, newlines, Unicode, and empty strings. It does not run an application, contact a server, or invoke an AI agent.

Disclosure: I maintain the independent Reverse Engineering Anything field guide. This resource is part of that guide's work on turning code observations into testable behavior. I am not the author of REA; its official project is morluto/rea.

Write down the exact target build, the artifact path on your own machine, and the behavior you want to understand. For an export, that might be column order, delimiter handling, quoting, character encoding, or what happens to missing values.

Use investigation-record.json as a blank worksheet. Empty fields mean unknown; they are not evidence that a feature is absent.

With Python 3 installed, save csv_behavior_fixtures.py and run:

python3 csv_behavior_fixtures.py --output-dir ./csv-fixtures

The script writes:

  • inputs.json : 36 rows of input strings, suitable for manually adapting to an application's own input format.
  • reference.csv : a concrete reference using UTF-8 without a BOM, comma delimiters, CRLF record endings, and minimal double-quote escaping.

It checks that Python's CSV reader restores all 36 input rows. Existing output files are not overwritten. No third-party Python packages are required.

This dialect is an explicit example specification, not a claim about any application's actual exporter. An application's different output is a difference to explain, not automatically a bug.

Statement What supports it What to record
The package contains a CSV writer A file/module reference Artifact version and source range
The export action can call that writer A connected entry point and call path Calls, wrappers, and unresolved branches
A particular input produced a particular file An authorized runtime observation Input, output bytes, target version, and reproduction steps

Static code inspection can support the first two without launching the target. It does not establish that a branch ran in a particular user session. If a wrapper or function name is ambiguous, keep the uncertainty in the worksheet.

Test the comma and quote cases first, then embedded newlines, Unicode, and empty strings. Check bytes as well as displayed cells: spreadsheet software may normalize line endings, interpret formulas, or hide encoding differences.

A CSV file with an embedded newline can contain more physical lines than records. Parse it with a CSV reader instead of counting newline characters. The fixtures use only strings; add separate tests if your target distinguishes a missing field, a null value, and an empty string.

When building your own implementation, compare the observed behavior you need to preserve. Record unresolved differences rather than claiming full reconstruction from one successful export.

REA can provide the inspection side of this workflow. Choose tools for your target type and consult its current official installation documentation. The fixture generator works independently of REA and does not imply any particular provider or host is supported.

The original code and worksheet in this Gist are offered under the MIT License; see LICENSE. They contain no target application code, binary, or recovered proprietary content.

── more in #developer-tools 4 stories · sorted by recency
── more on @python 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/csv-export-investiga…] indexed:0 read:3min 2026-10-17 · —