NetworkXImporter#

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

Bases: GraphImporter[AssetGraph, DiGraph]

Base class for importers that read through NetworkX graphs.

Methods

from_data(data, *[, kind, context])

Convert a NetworkX graph into an ECLYPSE graph.

from_data(data, *, kind=None, context=None)[source]#

Convert a NetworkX graph into an ECLYPSE graph.

Parameters:
  • data (nx.DiGraph) – The NetworkX graph to convert.

  • kind (GraphKind | None) – Graph kind requested by the caller.

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

Returns:

The converted graph object.

Return type:

AssetGraph

Raises:

ValueError – If kind is not provided.