Asset Module

starfish.asset.create_asset()

Create a new asset class based on the metadata. Once created assign the metadata to the asset and also the optional did

Parameters
  • metadata_text (str) – metadata text to test and create the correct asset object

  • did (str) – optional did to assign to the asset

  • asset (TAssetBase) – optional asset object to copy data (only for DataAsset)

Returns

Return an asset class based on the metadata type

starfish.asset.create_asset_provenance_invoke(asset: starfish.asset.asset_base.AssetBase, agent_did: str, job_id: str, asset_list: Any, inputs_text: str)

Add a invoke provenance data to the asset metadata. Calling this method will make the asset ‘new’. So the asset_id will change, and the asset.did will be set to None.

Parameters

agent_did (str) – DID of the agent that this asset will be registered with

starfish.asset.create_asset_provenance_publish(asset: starfish.asset.asset_base.AssetBase, agent_did: Optional[str] = None)

Add a published provenance data to the asset metadata. Calling this method will make the asset ‘new’. So the asset_id will change, and the asset.did will be set to None.

Parameters

agent_did (str) – DID of the agent that this asset will be registered with

starfish.asset.is_asset_hash_valid(asset_id, hash_hex)
Parameters
  • asset_id (str) – asset id to check against

  • hash_hex (str) – hex string to check

Returns

true if the hash string is the same as the asset_id

Type

boolean

starfish.asset.is_asset_id(text: str) bool

Return true if the string is a valid asset string (64 hex chars)