pystac.extensions.storage#

Implements the Storage Extension.

stac-extensions/storage

class pystac.extensions.storage.AssetStorageExtension(asset: Asset)[source]#

A concrete implementation of StorageExtension on an Asset that extends the Asset fields to include properties defined in the Storage Extension.

This class should generally not be instantiated directly. Instead, call StorageExtension.ext() on an Asset to extend it.

additional_read_properties: Iterable[dict[str, Any]] | None = None#

If present, this will be a list containing 1 dictionary representing the properties of the owning Item.

asset_href: str#

The href value of the Asset being extended.

properties: dict[str, Any]#

The Asset fields, including extension properties.

class pystac.extensions.storage.CloudPlatform(value)[source]#

An enumeration.

ALIBABA = 'ALIBABA'#
AWS = 'AWS'#
AZURE = 'AZURE'#
GCP = 'GCP'#
IBM = 'IBM'#
ORACLE = 'ORACLE'#
OTHER = 'OTHER'#
class pystac.extensions.storage.ItemAssetsStorageExtension(item_asset: AssetDefinition)[source]#
asset_defn: item_assets.AssetDefinition#
properties: dict[str, Any]#

The properties that this extension wraps.

The extension which implements PropertiesExtension can use _get_property and _set_property to get and set values on this instance. Note that _set_properties mutates the properties directly.

class pystac.extensions.storage.ItemStorageExtension(item: Item)[source]#

A concrete implementation of StorageExtension on an Item that extends the properties of the Item to include properties defined in the Storage Extension.

This class should generally not be instantiated directly. Instead, call StorageExtension.ext() on an Item to extend it.

item: pystac.Item#

The Item being extended.

properties: dict[str, Any]#

The Item properties, including extension properties.

class pystac.extensions.storage.StorageExtension[source]#

An abstract class that can be used to extend the properties of an Item or Asset with properties from the Storage Extension. This class is generic over the type of STAC Object to be extended (e.g. Item, Asset).

To create a concrete instance of StorageExtension, use the StorageExtension.ext() method. For example:

>>> item: pystac.Item = ...
>>> storage_ext = StorageExtension.ext(item)
apply(platform: CloudPlatform | None = None, region: str | None = None, requester_pays: bool | None = None, tier: str | None = None) None[source]#

Applies Storage Extension properties to the extended Item or Asset.

Parameters:
  • platform (str, CloudProvider) – The cloud provider where data is stored.

  • region (str) – The region where the data is stored. Relevant to speed of access and inter-region egress costs (as defined by PaaS provider).

  • requester_pays (bool) – Is the data requester pays or is it data manager/cloud provider pays.

  • tier (str) – The title for the tier type (as defined by PaaS provider).

classmethod ext(obj: T, add_if_missing: bool = False) StorageExtension[T][source]#

Extends the given STAC Object with properties from the Storage Extension.

This extension can be applied to instances of Item or Asset.

Raises:

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

classmethod get_schema_uri() str[source]#

Gets the schema URI associated with this extension.

name: Literal['storage'] = 'storage'#
property platform: CloudPlatform | None#

Get or sets the cloud provider where data is stored.

Returns:

str or None

property region: str | None#

Gets or sets the region where the data is stored. Relevant to speed of access and inter-region egress costs (as defined by PaaS provider).

property requester_pays: bool | None#
classmethod summaries(obj: Collection, add_if_missing: bool = False) SummariesStorageExtension[source]#

Returns the extended summaries object for the given collection.

property tier: str | None#
class pystac.extensions.storage.StorageExtensionHooks[source]#
prev_extension_ids: set[str] = {}#
schema_uri: str = 'https://stac-extensions.github.io/storage/v1.0.0/schema.json'#
stac_object_types = {STACObjectType.COLLECTION, STACObjectType.ITEM}#
class pystac.extensions.storage.SummariesStorageExtension(collection: Collection)[source]#

A concrete implementation of SummariesExtension that extends the summaries field of a Collection to include properties defined in the Storage Extension.

property platform: list[CloudPlatform] | None#

Get or sets the summary of StorageExtension.platform values for this Collection.

property region: list[str] | None#

Get or sets the summary of StorageExtension.region values for this Collection.

property requester_pays: list[bool] | None#

Get or sets the summary of StorageExtension.requester_pays values for this Collection.

summaries: Summaries#

The summaries for the Collection being extended.

property tier: list[str] | None#

Get or sets the summary of StorageExtension.tier values for this Collection.