NetworkXExporter#

class eclypse.io.defaults.networkx.NetworkXExporter[source]#

Bases: GraphExporter[TGraph, TGraph], Generic[TGraph]

Base class for exporters that write through NetworkX graphs.

Methods

networkx_graph(graph)

Return a NetworkX copy ready for file-format writers.

to_data(graph, *[, context])

Return the graph object handled by NetworkX exporters.

to_data(graph, *, context=None)[source]#

Return the graph object handled by NetworkX exporters.

Parameters:
  • graph (TGraph) – The graph to export.

  • context (IOContext | None) – Optional import/export customisation.

Returns:

The graph object to write.

Return type:

TGraph

networkx_graph(graph)[source]#

Return a NetworkX copy ready for file-format writers.

Parameters:

graph (AssetGraph) – The ECLYPSE graph to convert.

Returns:

A NetworkX copy carrying graph metadata.

Return type:

nx.DiGraph