trudag.dotstop.core.artifact
Artifact
Provides a class to interact with artifact files. This could used to export and import artifacts. This class also supports the context manager protocol to be able to rollback any changes during importing from artifact files in the case of failure.
export_to
export_to(
graph: TrustableGraph,
project_name: str,
file: Path,
validate: bool,
concurrent_validation: bool,
workers: int | None = None,
allow_failure: bool = False,
)
Exports an artifact including the graph and needs to the given file named with project_name.
Args:
graph(TrustableGraph): The graph to export through an artifact.
project_name(str): The name stored for the project in the artifact metadata.
file(Path): Output path for the artifact file.
import_from
import_from(
file: Path,
graph: TrustableGraph,
local_dot: Path,
namespace: str,
import_dir: Path,
)
Imports needs items and a resolved remote graph, to be prefixed with a namespace, from an artifact file into a import_dir directory.
Args:
file(Path): Input path for the artifact file.
graph(TrustableGraph): The local graph to be updated.
local_dot(Path): The path of the local dotstop file to be updated.
namespace(str): The namespace name to be prepended for the imported items.
import_dir(Path): The path of the output directory for the imported files to be stored.