Artifact
artifact ¶
handler ¶
ArtifactMetadata ¶
Bases: MutableDict[str, Any]
ArtifactHandler ¶
path: Path = Path(path) instance-attribute ¶
metadata = ArtifactMetadata(self) instance-attribute ¶
__init__(path: Union[str, Path]) -> None ¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | The path to the artifact | required |
load() -> Any abstractmethod ¶
Load the artifact from the path.
Returns:
| Type | Description |
|---|---|
Any | The loaded artifact. |
save(obj: Any, *args, **kwargs) abstractmethod ¶
Save the given artifact to the path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj | Any | The artifact to save. | required |
args | tuple | Additional positional arguments. | () |
kwargs | dict | Additional keyword arguments. | {} |
Returns:
| Type | Description |
|---|---|
None | |
can_handle(obj: object) -> bool abstractmethod classmethod ¶
Return True if this handler can handle the given object type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj | object | The object to check. | required |
Returns:
| Type | Description |
|---|---|
bool | True if this handler can handle the given object type. |
exists() -> bool ¶
Return True if the artifact exists.
Returns:
| Type | Description |
|---|---|
bool | True if the artifact exists. |
unlink() ¶
Unlink/delete the artifact.
Returns:
| Type | Description |
|---|---|
None | None |