Artifact
module artifact.py
artifact.py
function calculate_artifact_size
calculate_artifact_size
Tells about the size of the artifact
Args:
artifact_dir
(str): directory in which artifact is there.
Returns:
total size of the artifact
class ArtifactPath
ArtifactPath
ArtifactPath(src, dest)
class ArtifactVersion
ArtifactVersion
property artifact_fqn
Get fqn of the artifact
property created_at
Get the time at which artifact was created
property created_by
Get the information about who created the artifact
property description
Get description of the artifact
property fqn
Get fqn of the current artifact version
property metadata
Get metadata for the current artifact
property name
Get the name of the artifact
property step
Get the step in which artifact was created
property updated_at
Get the information about the when the artifact was updated
property version
Get version information of the artifact
function delete
delete
Deletes the current instance of the ArtifactVersion hence deleting the current version.
Returns:
True if artifact was deleted successfully
Examples:
import mlfoundry
client = mlfoundry.get_client()
artifact_version = client.get_artifact_version_by_fqn(fqn="<your-artifact-fqn>")
artifact_version.delete()
function download
download
Download an artifact file or directory to a local directory if applicable, and return a local path for it.
Args:
path
(str): Absolute path of the local filesystem destination directory to which to download the specified artifacts. This directory must already exist. If unspecified, the artifacts will either be downloaded to a new uniquely-named directory on the local filesystem or will be returned directly in the case of the Local ArtifactRepository.overwrite
(bool): If True it will overwrite the file if it is already present in the download directory else it will throw an error
Returns:
path
: Absolute path of the local filesystem location containing the desired artifacts.
Examples:
import mlfoundry
client = mlfoundry.get_client()
artifact_version = client.get_artifact_version_by_fqn(fqn="<your-artifact-fqn>")
artifact_version.download(path="<your-desired-download-path>")
classmethod from_fqn
from_fqn
Get the version of a Artifact to download contents or load them in memory
Args:
fqn
(str): Fully qualified name of the artifact version.
Returns:
ArtifactVersion
: An ArtifactVersion instance of the artifact
Examples:
import mlfoundry
client = mlfoundry.get_client()
artifact_version = mlfoundry.ArtifactVersion.from_fqn(fqn="<artifact-fqn>")
function raw_download
raw_download
Download an artifact file or directory to a local directory if applicable, and return a local path for it.
Args:
path
(str): Absolute path of the local filesystem destination directory to which to download the specified artifacts. This directory must already exist. If unspecified, the artifacts will either be downloaded to a new uniquely-named directory on the local filesystem or will be returned directly in the case of the Local ArtifactRepository.overwrite
(bool): If True it will overwrite the file if it is already present in the download directory else it will throw an error
Returns:
path
: Absolute path of the local filesystem location containing the desired artifacts.
Examples:
import mlfoundry
client = mlfoundry.get_client()
artifact_version = client.get_artifact_version_by_fqn(fqn="<your-artifact-fqn>")
artifact_version.raw_download(path="<your-desired-download-path>")
function update
update
Updates the current instance of the ArtifactVersion hence updating the current version.
Examples:
import mlfoundry
client = mlfoundry.get_client()
artifact_version = client.get_artifact_version_by_fqn(fqn="<your-artifact-fqn>")
artifact_version.description = 'This is the new description'
artifact_version.update()
Updated 2 months ago