MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _graph_to_json

Function _graph_to_json

tests/test_global_graph.py:29–35  ·  view source on GitHub ↗
(G, path)

Source from the content-addressed store, hash-verified

27
28
29def _graph_to_json(G, path):
30 from networkx.readwrite import json_graph as jg
31 try:
32 data = jg.node_link_data(G, edges="links")
33 except TypeError:
34 data = jg.node_link_data(G)
35 path.write_text(json.dumps(data), encoding="utf-8")
36
37
38# ── build.py helpers ──────────────────────────────────────────────────────────

Calls

no outgoing calls

Tested by

no test coverage detected