xgi.readwrite.json
Read from and write to JSON.
Functions
- xgi.readwrite.json.read_json(path, nodetype=None, edgetype=None)[source]
A function to read a file in a standardized JSON format.
- Parameters:
data (dict) – A dictionary in the hypergraph JSON format
nodetype (type, optional) – type that the node IDs will be cast to
edgetype (type, optional) – type that the edge IDs will be cast to
- Returns:
The loaded hypergraph
- Return type:
A Hypergraph object
- Raises:
XGIError – If the JSON is not in a format that can be loaded.