This repository has no description
292 B
12 lines
1{ pkgs, ... }:
2pkgs.writers.writePython3Bin "graphml2json" { libraries = [ pkgs.python3Packages.networkx ]; } ''
3 import networkx as nx
4 import json
5 import sys
6
7
8 G = nx.read_graphml(sys.argv[1])
9 data = nx.readwrite.json_graph.node_link_data(G)
10
11 print(json.dumps(data, indent=2))
12''