MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _write_csv

Function _write_csv

experiments/token_cost/measure_day_token_usage.py:382–390  ·  view source on GitHub ↗
(path: Path, rows: List[Dict[str, Any]])

Source from the content-addressed store, hash-verified

380
381
382def _write_csv(path: Path, rows: List[Dict[str, Any]]) -> None:
383 if not rows:
384 path.write_text("", encoding="utf-8")
385 return
386 fieldnames = list(rows[0].keys())
387 with path.open("w", encoding="utf-8-sig", newline="") as handle:
388 writer = csv.DictWriter(handle, fieldnames=fieldnames)
389 writer.writeheader()
390 writer.writerows(rows)
391
392
393def _to_markdown(rows: List[Dict[str, Any]]) -> str:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected