AssetCard

final class fairseq2.assets.AssetCard(metadata, base=None, *, value_converter=None)[source]

Bases: object

Holds information about an asset.

Parameters:
  • metadata (MutableMapping[str, Any]) – The metadata to be held in the card. Each key-value item should contain a specific piece of information about the asset.

  • base (Optional[AssetCard]) – The card that this card derives from.

  • value_converter (Optional[ValueConverter]) – The ValueConverter instance to use. If None, the default instance will be used.

field(name)[source]

Return a field of this card.

If the card does not contain the specified field, its base card will be checked recursively.

Parameters:

name (str) – The name of the field.

Return type:

AssetCardField

property base: AssetCard | None

The card that this card derives from.

property metadata: Mapping[str, Any]

The metadata of the asset.

property name: str

The name of the asset.