0

I have a JSON with the following format:

{
  "directed": false,
  "multigraph": false,
  "nodes": [
    {
      "bad_val": {
      ...
      }
      "id": "node_id"
   ]
}

This JSON represents a NetworkX graph created using the node_link_data function in my Python script. I'd like to parse it back into a NetworkX graph, however, the inclusion of the "bad value", makes the JSON obscenely large, and I'd like to find some way to parse it without the bad value.

I've looked into using ijson to do this, however, I've found two problems with this: firstly, the only way I can see to use ijson to do this is to use the parse function and reconstruct the string bit by bit, which I feel might be more inefficient than just parsing the whole JSON outright. Secondly, ijson is used to parse values back into their original data structures, not into another JSON string, so doing this would be very difficult.

Does anyone have any ideas?

0 Answers0