cdlib.readwrite.read_community_from_json_string

cdlib.readwrite.read_community_from_json_string(json_repr: str) object

Read community list from JSON file.

Parameters:

json_repr – json community representation

Returns:

a Clustering object

Example:

>>> import networkx as nx
>>> from cdlib import algorithms, readwrite
>>> g = nx.karate_club_graph()
>>> coms = algorithms.louvain(g)
>>> readwrite.write_community_json(coms, "communities.json")