pystac.extensions.version#
Implements the Versioning Indicators Extension.
- class pystac.extensions.version.AssetVersionExtension(asset: Asset)[source]#
A concrete implementation of
VersionExtensionon anAssetthat extends the properties of the Asset to include properties defined in the Versioning Indicators Extension.This class should generally not be instantiated directly. Instead, call
VersionExtension.ext()on anAssetto extend it.- properties: dict[str, Any]#
The properties that this extension wraps.
The extension which implements PropertiesExtension can use
_get_propertyand_set_propertyto get and set values on this instance. Note that _set_properties mutates the properties directly.
- class pystac.extensions.version.BaseVersionExtension[source]#
A base extension that just gets and sets attributes, not links.
Used for Assets and AssetDefinitions.
- apply_base(version: str | None = None, deprecated: bool | None = None, experimental: bool | None = None) None[source]#
Applies attributes to this extension object.
- property deprecated: bool | None#
Get or sets whether this object is deprecated.
A value of
Truespecifies that the object is deprecated with the potential to be removed. It should be transitioned out of usage as soon as possible and users should refrain from using it in new projects. A link with relation typelatest-versionSHOULD be added to the links and MUST refer to the resource that can be used instead.Note
A
pystac.DeprecatedWarningis issued if thedeprecatedproperty isTruewhen deserializing a dictionary to an object. Theignore_deprecated()context manager is provided as a convenience to suppress these warnings:>>> with ignore_deprecated(): ... deprecated_item = pystac.Item.from_dict(deprecated_item_dict)
- property experimental: bool | None#
Get and set whether this object is experimental.
Specifies that the context this field is used in (e.g. Asset or Collection) is experimental with the potential to break or be unstable.
- classmethod ext(obj: T, add_if_missing: bool = False) BaseVersionExtension[T][source]#
Extends the given STAC Object with properties from the Versioning Indicators Extension.
- Raises:
pystac.ExtensionTypeError – If an invalid object type is passed.
- name: Literal['version'] = 'version'#
- property version: str | None#
Get or sets a version string of this object.
- class pystac.extensions.version.CatalogVersionExtension(catalog: Catalog)[source]#
A concrete implementation of
VersionExtensionon aCatalogthat extends the properties of the Catalog to include properties defined in the Versioning Indicators Extension.This class should generally not be instantiated directly. Instead, call
VersionExtension.ext()on anCatalogto extend it.- properties: dict[str, Any]#
The properties that this extension wraps.
The extension which implements PropertiesExtension can use
_get_propertyand_set_propertyto get and set values on this instance. Note that _set_properties mutates the properties directly.
- class pystac.extensions.version.CollectionVersionExtension(collection: Collection)[source]#
A concrete implementation of
VersionExtensionon aCollectionthat extends the properties of the Collection to include properties defined in the Versioning Indicators Extension.This class should generally not be instantiated directly. Instead, call
VersionExtension.ext()on anCollectionto extend it.- collection: Collection#
- properties: dict[str, Any]#
The properties that this extension wraps.
The extension which implements PropertiesExtension can use
_get_propertyand_set_propertyto get and set values on this instance. Note that _set_properties mutates the properties directly.
- class pystac.extensions.version.ItemAssetsViewExtension(item_asset: ItemAssetDefinition)[source]#
- properties: dict[str, Any]#
The properties that this extension wraps.
The extension which implements PropertiesExtension can use
_get_propertyand_set_propertyto get and set values on this instance. Note that _set_properties mutates the properties directly.
- class pystac.extensions.version.ItemVersionExtension(item: Item)[source]#
A concrete implementation of
VersionExtensionon anItemthat extends the properties of the Item to include properties defined in the Versioning Indicators Extension.This class should generally not be instantiated directly. Instead, call
VersionExtension.ext()on anItemto extend it.- properties: dict[str, Any]#
The properties that this extension wraps.
The extension which implements PropertiesExtension can use
_get_propertyand_set_propertyto get and set values on this instance. Note that _set_properties mutates the properties directly.
- class pystac.extensions.version.T#
Generalized version of
Catalog,Collection,Item,AssetorItemAssetDefinitionalias of TypeVar(‘T’, ~pystac.catalog.Catalog, ~pystac.collection.Collection, ~pystac.item.Item, ~pystac.asset.Asset, ~pystac.item_assets.ItemAssetDefinition)
- class pystac.extensions.version.U#
Generalized version of
Catalog,Collection, orItemalias of TypeVar(‘U’, ~pystac.catalog.Catalog, ~pystac.collection.Collection, ~pystac.item.Item)
- class pystac.extensions.version.VersionExtension(obj: STACObject)[source]#
An abstract class that can be used to extend the properties of an
Item,Collection, orCatalogwith properties from the Versioning Indicators Extension. This class is generic over the type of STAC Object to be extended.To create a concrete instance of
VersionExtension, use theVersionExtension.ext()method. For example:>>> item: pystac.Item = ... >>> version_ext = VersionExtension.ext(item)
- apply(version: str | None = None, deprecated: bool | None = None, experimental: bool | None = None, latest: U | None = None, predecessor: U | None = None, successor: U | None = None) None[source]#
Applies version extension properties to the extended
ItemorCollection.- Parameters:
version – The version string for the item.
deprecated – Optional flag set to
Trueif an Item is deprecated with the potential to be removed. Defaults toFalseif not present.latest – Item representing the latest (e.g., current) version.
predecessor – Item representing the resource containing the predecessor version in the version history.
successor – Item representing the resource containing the successor version in the version history.
- classmethod ext(obj: U, add_if_missing: bool = False) VersionExtension[U][source]#
Extends the given STAC Object with properties from the Versioning Indicators Extension.
This extension can be applied to instances of
ItemorCollection.- Raises:
pystac.ExtensionTypeError – If an invalid object type is passed.
- obj: STACObject#
- class pystac.extensions.version.VersionExtensionHooks[source]#
- get_object_links(so: STACObject) list[str] | None[source]#
- prev_extension_ids = {'https://stac-extensions.github.io/version/v1.0.0/schema.json', 'https://stac-extensions.github.io/version/v1.1.0/schema.json', 'version'}#
- schema_uri = 'https://stac-extensions.github.io/version/v1.2.0/schema.json'#
- stac_object_types = {'Catalog', 'Collection', 'Feature'}#
- class pystac.extensions.version.VersionRelType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
A list of rel types defined in the Version Extension.
See the Version Extension Relation types documentation for details.
- HISTORY = 'version-history'#
This link points to a version history or changelog.
This can be for example a Markdown file with the corresponding media type or a STAC Catalog or Collection.
- LATEST = 'latest-version'#
Indicates a link pointing to a resource containing the latest version.
- PREDECESSOR = 'predecessor-version'#
Indicates a link pointing to a resource containing the predecessor version in the version history.
- SUCCESSOR = 'successor-version'#
Indicates a link pointing to a resource containing the successor version in the version history.
- pystac.extensions.version.ignore_deprecated() Generator[None][source]#
Context manager for suppressing the
pystac.DeprecatedWarningwhen creating a deprecatedItemorCollectionfrom a dictionary.