← ClaudeAtlas

csv-report-writerlisted

Turn a run's list of result dicts into a schema'd CSV and a Markdown table from one column spec - declare columns once, emit both, with stable ordering and safe escaping, stdlib only, no pandas. Use when the user asks to write results to CSV, export a report, make a markdown summary table, or save a run's output as a spreadsheet.
baronguyen001/ai-automation-skills · ★ 0 · Data & Documents · score 75
Install: claude install-skill baronguyen001/ai-automation-skills
# CSV Report Writer Use this skill when a job produces a list of result rows and you want a tidy CSV for spreadsheets plus a Markdown table for a PR comment or Telegram digest - from a single column definition, so the two outputs never drift. You declare the columns (key, header, optional formatter) once; the helper emits both, in a stable column order, with proper CSV quoting and pipe-escaping for Markdown. No pandas. ## When to invoke - User says: "write the results to a CSV", "export a report", "make a markdown table of this", "save the run output as a spreadsheet". - Code in the conversation has a `list[dict]` (or list of objects) it currently prints ad hoc. ## When NOT to invoke - The data needs real dataframe work - joins, group-bys, pivots; reach for pandas/polars instead. - A single scalar result, where a CSV/table is overkill. ## Concrete example User input: ```text I have a list of scanned tokens with a score and price. Save a CSV and also give me a markdown table for the Telegram digest. ``` Output: ```python # Copy assets/report.py into your project, then: from report import Column, write_csv, to_markdown columns = [ Column("symbol", "Symbol"), Column("score", "Score", fmt=lambda v: f"{v:.1f}"), Column("price_usd", "Price", fmt=lambda v: f"${v:,.4f}"), ] rows = [ {"symbol": "ABC", "score": 8.4, "price_usd": 0.0123}, {"symbol": "XYZ", "score": 6.1, "price_usd": 1.5}, ] write_csv("scan.csv", columns, rows) # schema'd CSV, stabl