GraphExporter#

class eclypse.io.base.GraphExporter[source]#

Bases: ABC, Generic[TGraph, TData]

Base class for graph exporters.

Exporters convert an ECLYPSE graph object into an intermediate data representation, then write that representation to a destination. Subclasses normally implement to_data() and write_data().

Methods

dump(graph, target, *[, context])

Export a graph object to the provided target.

to_data(graph, *[, context])

Convert a graph object into the exporter intermediate representation.

write_data(data, target, *[, context])

Write exporter data to a target.

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

Export a graph object to the provided target.

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

  • target (str | Path) – The target path where the graph is written.

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

Return type:

None

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

Convert a graph object into the exporter intermediate representation.

Parameters:
  • graph (TGraph) – The graph object to convert.

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

Returns:

The intermediate representation handled by write_data().

Return type:

TData

abstractmethod write_data(data, target, *, context=None)[source]#

Write exporter data to a target.

Parameters:
  • data (TData) – The intermediate representation to write.

  • target (str | Path) – The target path where data is written.

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

Return type:

None