pystac.extensions.storage#

Implements the Storage Extension.

https://github.com/stac-extensions/storage

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

A concrete implementation of StorageExtension on an Asset that extends the properties of the Asset 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.

asset: pystac.Asset#

The Asset being extended.

properties: dict[str, Any]#

The Asset properties, including extension properties.

class pystac.extensions.storage.CatalogStorageExtension(catalog: Catalog)[source]#

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

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

catalog: pystac.Catalog#

The Catalog being extended.

properties: dict[str, Any]#

The Catalog properties, including extension properties.

class pystac.extensions.storage.CollectionStorageExtension(collection: Collection)[source]#

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

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

collection: pystac.Collection#

The Collection being extended.

properties: dict[str, Any]#

The Collection properties, including extension properties.

class pystac.extensions.storage.ItemAssetsStorageExtension(item_asset: ItemAssetDefinition)[source]#

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

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

item_asset: pystac.ItemAssetDefinition#

The ItemAssetDefinition being extended.

properties: dict[str, Any]#

The ItemAssetDefinition properties, including extension properties.

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

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

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

The Link being extended.

properties: dict[str, Any]#

The Link properties, including extension properties.

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

An class that can be used to extend the properties of an Catalog, Collection, Item, Asset, Link, or ItemAssetDefinition with properties from the Storage Extension. This class is generic over the type of STAC Object to be extended (e.g. Item, Collection). To create a concrete instance of StorageExtension, use the StorageExtension.ext() method. For example:

>>> item: pystac.Item = ...
>>> storage_ext = StorageExtension.ext(item)
add_ref(ref: str) None[source]#
add_scheme(key: str, scheme: StorageScheme) None[source]#
apply(*, schemes: dict[str, StorageScheme] | None = None, refs: list[str] | None = None) None[source]#
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 Catalog, Collection, Item, Asset, Link, or ItemAssetDefinition.

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 refs: list[str]#
property schemes: dict[str, StorageScheme]#
classmethod summaries(obj: Collection, add_if_missing: bool = False) SummariesStorageExtension[source]#

Returns the extended summaries object for the given collection.

class pystac.extensions.storage.StorageExtensionHooks[source]#
migrate(obj: dict[str, Any], version: STACVersionID, info: 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 = {'https://stac-extensions.github.io/storage/v1.0.0/schema.json'}#
schema_uri: str = 'https://stac-extensions.github.io/storage/v2.0.0/schema.json'#
stac_object_types = {'Catalog', 'Collection', 'Feature'}#
class pystac.extensions.storage.StorageScheme(properties: dict[str, Any])[source]#

Helper class for storage scheme objects.

Can set well-defined properties, or if needed, any arbitrary property.

apply(type: str, platform: str, region: str | None = None, requester_pays: bool | None = None, **kwargs: Any) None[source]#
classmethod create(type: str, platform: str, region: str | None = None, requester_pays: bool | None = None, **kwargs: Any) StorageScheme[source]#

Set the properties for a new StorageScheme object.

Additional properties can be set through kwargs to fulfill any additional variables in a templated uri.

Parameters:
  • type (str) – Type identifier for the platform.

  • platform (str) – The cloud provider where data is stored as URI or URI template to the API.

  • region (str | None) – The region where the data is stored. Defaults to None.

  • requester_pays (bool | None) – requester pays or data manager/cloud provider pays. Defaults to None.

  • kwargs (dict[str | Any]) – Additional properties to set on scheme

Returns:

storage scheme

Return type:

StorageScheme

property platform: str#

Get or set the required platform property

property region: str | None#

Get or set the optional region property

property requester_pays: bool | None#

Get or set the optional requester_pays property

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

Returns the dictionary encoding of this object

Returns:

The dictionary encoding of this object

Return type:

dict[str, Any]

property type: str#

Get or set the required type property

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

An enumeration.

AWS_S3 = 'aws-s3'#
AZURE = 'ms-azure'#
CUSTOM_S3 = 'custom-s3'#
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 schemes: list[dict[str, StorageScheme]] | None#

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

class pystac.extensions.storage.T#

Generalized version of Catalog, Collection, Item, Asset, Link, or ItemAssetDefinition

alias of TypeVar(‘T’, ~pystac.catalog.Catalog, ~pystac.collection.Collection, ~pystac.item.Item, ~pystac.asset.Asset, ~pystac.link.Link, ~pystac.item_assets.ItemAssetDefinition)