File size: 456 Bytes
bb0b469
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from typing import List, Dict
import json
import uuid

def export_icij_bundle(results: List[Dict]) -> str:
    bundle = {
        "bundle_id": str(uuid.uuid4()),
        "documents": results,
        "schema": "ICIJ Investigative Dataset v1",
        "notes": "For collaborative investigative journalism"
    }

    path = f"/tmp/icij_bundle_{bundle['bundle_id']}.json"
    with open(path, "w") as f:
        json.dump(bundle, f, indent=2)

    return path