MCPcopy Index your code
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / export_to_json

Function export_to_json

scrapegraphai/utils/data_export.py:16–25  ·  view source on GitHub ↗

Export data to a JSON file. :param data: List of dictionaries containing the data to export :param filename: Name of the file to save the JSON data

(data: List[Dict[str, Any]], filename: str)

Source from the content-addressed store, hash-verified

14
15
16def export_to_json(data: List[Dict[str, Any]], filename: str) -> None:
17 """
18 Export data to a JSON file.
19
20 :param data: List of dictionaries containing the data to export
21 :param filename: Name of the file to save the JSON data
22 """
23 with open(filename, "w", encoding="utf-8") as f:
24 json.dump(data, f, ensure_ascii=False, indent=4)
25 logger.info("Data exported to %s", filename)
26
27
28def export_to_csv(data: List[Dict[str, Any]], filename: str) -> None:

Callers 1

Calls 1

infoMethod · 0.45

Tested by 1