Skip to content

Importer

Importer

Bases: ABC

Abstract class for importers to configure an engine and its components from different text formats.

related

Functions

__repr__

__repr__() -> str

Return the Python code to construct the importer.

Returns:

Type Description
str

Python code to construct the importer.

__str__

__str__() -> str

Return the class name of the importer.

Returns:

Type Description
str

class name of the importer.

from_file

from_file(path: Path | str) -> Engine

Read from the file the text representation of an engine.

Parameters:

Name Type Description Default
path Path | str

file path to import engine

required

Returns:

Type Description
Engine

engine represented in the file

from_string abstractmethod

from_string(text: str) -> Engine

Return the engine described in the text representation.

Parameters:

Name Type Description Default
text str

representation of the engine to import

required

Returns:

Type Description
Engine

engine described in the text representation