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
StorageExtensionon anAssetthat 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 anAssetto extend it.- asset: pystac.Asset#
The
Assetbeing extended.
- class pystac.extensions.storage.CatalogStorageExtension(catalog: Catalog)[source]#
A concrete implementation of
StorageExtensionon anCatalogthat 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 anCatalogto extend it.- catalog: pystac.Catalog#
The
Catalogbeing extended.
- class pystac.extensions.storage.CollectionStorageExtension(collection: Collection)[source]#
A concrete implementation of
StorageExtensionon anCollectionthat 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 anCollectionto extend it.- collection: pystac.Collection#
The
Collectionbeing extended.
- properties: dict[str, Any]#
The
Collectionproperties, including extension properties.
- class pystac.extensions.storage.ItemAssetsStorageExtension(item_asset: ItemAssetDefinition)[source]#
A concrete implementation of
StorageExtensionon anItemAssetDefinitionthat 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 anItemAssetDefinitionto extend it.- item_asset: pystac.ItemAssetDefinition#
The
ItemAssetDefinitionbeing extended.
- properties: dict[str, Any]#
The
ItemAssetDefinitionproperties, including extension properties.
- class pystac.extensions.storage.LinkStorageExtension(link: Link)[source]#
A concrete implementation of
StorageExtensionon anLinkthat 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 anLinkto extend it.- link: pystac.Link#
The
Linkbeing extended.
- class pystac.extensions.storage.StorageExtension[source]#
An class that can be used to extend the properties of an
Catalog,Collection,Item,Asset,Link, orItemAssetDefinitionwith 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 ofStorageExtension, use theStorageExtension.ext()method. For example:>>> item: pystac.Item = ... >>> storage_ext = StorageExtension.ext(item)
- 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, orItemAssetDefinition.- Raises:
pystac.ExtensionTypeError – If an invalid object type is passed.
- name: Literal['storage'] = 'storage'#
- 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'}#
- 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:
- 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
SummariesExtensionthat extends thesummariesfield of aCollectionto include properties defined in the Storage Extension.- property schemes: list[dict[str, StorageScheme]] | None#
Get or sets the summary of
StorageScheme.platformvalues for this Collection.
- class pystac.extensions.storage.T#
Generalized version of
Catalog,Collection,Item,Asset,Link, orItemAssetDefinitionalias of TypeVar(‘T’, ~pystac.catalog.Catalog, ~pystac.collection.Collection, ~pystac.item.Item, ~pystac.asset.Asset, ~pystac.link.Link, ~pystac.item_assets.ItemAssetDefinition)