Skip to main content
`Ctrl`+`K`

# pystac.extensions.storage

Implements the Storage Extension.

stac-extensions/storage

class pystac.extensions.storage.AssetStorageExtension(asset: Asset)

  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, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
  ALIBABA = 'ALIBABA'
  AWS = 'AWS'
  AZURE = 'AZURE'
  GCP = 'GCP'
  IBM = 'IBM'
  ORACLE = 'ORACLE'
  OTHER = 'OTHER'

class pystac.extensions.storage.ItemAssetsStorageExtension(item_asset: ItemAssetDefinition)
  asset_defn: ItemAssetDefinition
  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)

  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: Item

    The `Item` being extended.

  properties: dict[str, Any]

    The `Item` properties, including extension properties.

class pystac.extensions.storage.StorageExtension

  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

    Applies Storage Extension properties to the extended `Item` or `Asset`.

    Parameters:

      - platform (str, CloudPlatform) – 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]

    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

    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

    Returns the extended summaries object for the given collection.

  property tier: str | None

class pystac.extensions.storage.StorageExtensionHooks
  prev_extension_ids: set[str] = {}
  schema_uri: str = 'https://stac-extensions.github.io/storage/v1.0.0/schema.json'
  stac_object_types = {'Collection', 'Feature'}

class pystac.extensions.storage.SummariesStorageExtension(collection: Collection)

  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.

  property tier: list[str] | None

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

class pystac.extensions.storage.T

  Generalized version of `Item`, `Asset` or `ItemAssetDefinition`

  alias of TypeVar(‘T’, ~pystac.item.Item, ~pystac.asset.Asset, ~pystac.item_assets.ItemAssetDefinition)