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

Function export_to_jsonl

experiments/benchmark/export_daily_data.py:184–196  ·  view source on GitHub ↗

导出为 JSONL 格式

(records: List[Dict], output_path: Path, flatten_func=None)

Source from the content-addressed store, hash-verified

182
183
184def export_to_jsonl(records: List[Dict], output_path: Path, flatten_func=None) -> None:
185 """导出为 JSONL 格式"""
186 if not records:
187 print(" No records to export")
188 return
189
190 with output_path.open("w", encoding="utf-8") as f:
191 for r in records:
192 if flatten_func:
193 r = flatten_func(r)
194 f.write(json.dumps(r, ensure_ascii=False) + "\n")
195
196 print(f" Exported {len(records)} records to {output_path}")
197
198
199def main():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected