Graph Profiler

Class and functions to calculate and profile properties of graph data.

class dataprofiler.profilers.graph_profiler.GraphProfiler(data: nx.Graph | GraphData, options: ProfilerOptions = None)

Bases: object

GraphProfiler class.

Creates a profile describing a graph dataset Statistical properties of graph

Initialize Graph Profiler.

Parameters
times: dict

Properties

property profile: dict

Return the profile of the graph.

Returns

the profile of the graph in data

diff(other_profile: dataprofiler.profilers.graph_profiler.GraphProfiler, options: Optional[dict] = None) dict

Find the differences for two graph profiles.

Parameters
  • other_profile (GraphProfiler) – profile to find the difference with

  • options (dict) – options for diff output

Returns

the difference between profiles

Return type

dict

report(remove_disabled_flag: bool = False) dict

Report on profile attribute of the class.

Pop value from self.profile if key not in self.__calculations

update(graph: networkx.classes.graph.Graph) dataprofiler.profilers.graph_profiler.GraphProfiler

Update the graph profile.

Parameters

data (NetworkX Graph) – networkx graph

Returns

None

save(filepath: Optional[str] = None) None

Save profiler to disk.

Parameters

filepath (String) – Path of file to save to

Returns

None

classmethod load(filepath: str) dataprofiler.profilers.graph_profiler.GraphProfiler

Load profiler from disk.

Parameters

filepath (String) – Path of file to load from

Returns

GraphProfiler being loaded

Return type

GraphProfiler