artifact

FABRIC artifact management and representation.

This module provides the Artifact class for working with FABRIC artifacts stored in the Artifact Manager service. Artifacts are reusable resources such as code, data, images, or configurations that can be shared across experiments and projects.

class fabrictestbed_extensions.fablib.artifact.Artifact(artifact_info, fablib_manager)[source]

Initialize an Artifact object with metadata.

Parameters:
  • artifact_info (dict) – Dictionary containing artifact metadata from the Artifact Manager, including title, UUID, description, authors, versions, project information, and timestamps.

  • fablib_manager (FablibManager) – Reference to the FablibManager instance for accessing FABRIC services and configuration.

get_fablib_manager()[source]

Get the Fabric library manager associated with this artifact.

Returns:

The Fabric library manager instance.

Return type:

FablibManager

to_dict()[source]

Convert artifact information into a dictionary format.

Transforms the raw artifact metadata into a simplified dictionary structure suitable for display or serialization. Formats author emails as a comma-separated string and versions with their URNs.

Returns:

Dictionary containing artifact fields including title, uuid, description_short, project_name, authors (comma-separated), versions (newline-separated version#URN pairs), visibility, created, and modified timestamps.

Return type:

dict

to_json()[source]

Convert the Artifact object to a JSON string.

Returns:

JSON string representation of the Artifact object with 4-space indentation.

Return type:

str

class fabrictestbed_extensions.fablib.artifact.Artifact(artifact_info, fablib_manager)[source]

Initialize an Artifact object with metadata.

Parameters:
  • artifact_info (dict) – Dictionary containing artifact metadata from the Artifact Manager, including title, UUID, description, authors, versions, project information, and timestamps.

  • fablib_manager (FablibManager) – Reference to the FablibManager instance for accessing FABRIC services and configuration.

__str__()[source]

Convert the Artifact object to a string representation in JSON format.

Returns:

JSON string representation of the Artifact object.

Return type:

str

get_fablib_manager()[source]

Get the Fabric library manager associated with this artifact.

Returns:

The Fabric library manager instance.

Return type:

FablibManager

to_dict()[source]

Convert artifact information into a dictionary format.

Transforms the raw artifact metadata into a simplified dictionary structure suitable for display or serialization. Formats author emails as a comma-separated string and versions with their URNs.

Returns:

Dictionary containing artifact fields including title, uuid, description_short, project_name, authors (comma-separated), versions (newline-separated version#URN pairs), visibility, created, and modified timestamps.

Return type:

dict

to_json()[source]

Convert the Artifact object to a JSON string.

Returns:

JSON string representation of the Artifact object with 4-space indentation.

Return type:

str