pystac.extensions.item_assets#

Implements the Item Assets Definition Extension.

class pystac.extensions.item_assets.AssetDefinition(properties: Dict[str, Any])[source]#

Bases: object

Object that contains details about the datafiles that will be included in member Items for this Collection.

See the Asset Object for details.

apply(title: Optional[str], description: Optional[str], media_type: Optional[str], roles: Optional[List[str]]) None[source]#

Sets the properties for this asset definition.

Parameters
  • title – Displayed title for clients and users.

  • description – Description of the Asset providing additional details, such as how it was processed or created. CommonMark 0.29 syntax MAY be used for rich text representation.

  • media_typemedia type of the asset.

  • rolessemantic roles of the asset, similar to the use of rel in links.

classmethod create(title: Optional[str], description: Optional[str], media_type: Optional[str], roles: Optional[List[str]]) pystac.extensions.item_assets.AssetDefinition[source]#

Creates a new asset definition.

Parameters
  • title – Displayed title for clients and users.

  • description – Description of the Asset providing additional details, such as how it was processed or created. CommonMark 0.29 syntax MAY be used for rich text representation.

  • media_typemedia type of the asset.

  • rolessemantic roles of the asset, similar to the use of rel in links.

create_asset(href: str) pystac.asset.Asset[source]#

Creates a new Asset instance using the fields from this AssetDefinition and the given href.

property description: Optional[str]#

Gets or sets a description of the Asset providing additional details, such as how it was processed or created. CommonMark 0.29 syntax MAY be used for rich text representation.

property media_type: Optional[str]#

Gets or sets the media type of the asset.

properties: Dict[str, Any]#
property roles: Optional[List[str]]#

Gets or sets the semantic roles of the asset, similar to the use of rel in links.

property title: Optional[str]#

Gets or sets the displayed title for clients and users.

to_dict() Dict[str, Any][source]#

Returns a JSON-like dictionary representing this AssetDefinition.

class pystac.extensions.item_assets.ItemAssetsExtension(collection: pystac.collection.Collection)[source]#

Bases: pystac.extensions.base.ExtensionManagementMixin[pystac.collection.Collection]

collection: pystac.collection.Collection#
classmethod ext(obj: pystac.collection.Collection, add_if_missing: bool = False) pystac.extensions.item_assets.ItemAssetsExtension[source]#

Extends the given Collection with properties from the Item Assets Extension.

Raises

pystac.ExtensionTypeError – If an invalid object type is passed.

classmethod get_schema_uri() str[source]#

Gets the schema URI associated with this extension.

property item_assets: Dict[str, pystac.extensions.item_assets.AssetDefinition]#

Gets or sets a dictionary of assets that can be found in member Items. Maps the asset key to an AssetDefinition instance.

class pystac.extensions.item_assets.ItemAssetsExtensionHooks[source]#

Bases: pystac.extensions.hooks.ExtensionHooks

migrate(obj: Dict[str, Any], version: pystac.serialization.identify.STACVersionID, info: pystac.serialization.identify.STACJSONDescription) None[source]#

Migrate a STAC Object in dict format from a previous version. The base implementation will update the stac_extensions to the latest schema ID. This method will only be called for STAC objects that have been identified as a previous version of STAC. Implementations should directly manipulate the obj dict. Remember to call super() in order to change out the old ‘stac_extension’ entry with the latest schema URI.

prev_extension_ids = {'asset', 'item-assets'}#
schema_uri: str = 'https://stac-extensions.github.io/item-assets/v1.0.0/schema.json'#
stac_object_types = {STACObjectType.COLLECTION}#