pystac.extensions.timestamps#

Implements the Timestamps Extension.

class pystac.extensions.timestamps.AssetTimestampsExtension(asset: pystac.asset.Asset)[source]#

Bases: pystac.extensions.timestamps.TimestampsExtension[pystac.asset.Asset]

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

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

additional_read_properties: Optional[Iterable[Dict[str, Any]]] = 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.timestamps.ItemTimestampsExtension(item: pystac.item.Item)[source]#

Bases: pystac.extensions.timestamps.TimestampsExtension[pystac.item.Item]

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

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

item: pystac.item.Item#

The Item being extended.

properties: Dict[str, Any]#

The Item properties, including extension properties.

class pystac.extensions.timestamps.SummariesTimestampsExtension(collection: pystac.collection.Collection)[source]#

Bases: pystac.extensions.base.SummariesExtension

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

property expires: Optional[pystac.summaries.RangeSummary[datetime.datetime]]#

Get or sets the summary of TimestampsExtension.expires values for this Collection.

property published: Optional[pystac.summaries.RangeSummary[datetime.datetime]]#

Get or sets the summary of TimestampsExtension.published values for this Collection.

summaries: pystac.summaries.Summaries#

The summaries for the Collection being extended.

property unpublished: Optional[pystac.summaries.RangeSummary[datetime.datetime]]#

Get or sets the summary of TimestampsExtension.unpublished values for this Collection.

class pystac.extensions.timestamps.TimestampsExtension(*args, **kwds)[source]#

Bases: Generic[pystac.extensions.timestamps.T], pystac.extensions.base.PropertiesExtension, pystac.extensions.base.ExtensionManagementMixin[Union[pystac.collection.Collection, pystac.item.Item]]

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

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

>>> item: pystac.Item = ...
>>> ts_ext = TimestampsExtension.ext(item)
apply(published: Optional[datetime.datetime] = None, expires: Optional[datetime.datetime] = None, unpublished: Optional[datetime.datetime] = None) None[source]#

Applies timestamps extension properties to the extended Item.

Parameters
  • published – Date and time the corresponding data was published the first time.

  • expires – Date and time the corresponding data expires (is not valid any longer).

  • unpublished – Date and time the corresponding data was unpublished.

property expires: Optional[datetime.datetime]#

Gets or sets a datetime object that represents the date and time the corresponding data expires (is not valid any longer).

‘Expires’ has a different meaning depending on where it is used. If available in the asset properties, it refers to the timestamps valid for the actual data linked to the Asset Object. If it comes from the Item properties, it refers to to the timestamp valid for the metadata.

classmethod ext(obj: pystac.extensions.timestamps.T, add_if_missing: bool = False) pystac.extensions.timestamps.TimestampsExtension[pystac.extensions.timestamps.T][source]#

Extends the given STAC Object with properties from the Timestamps 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.

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.

property published: Optional[datetime.datetime]#

Gets or sets a datetime object that represents the date and time that the corresponding data was published the first time.

‘Published’ has a different meaning depending on where it is used. If available in the asset properties, it refers to the timestamps valid for the actual data linked to the Asset Object. If it comes from the Item properties, it refers to timestamp valid for the metadata.

classmethod summaries(obj: pystac.collection.Collection, add_if_missing: bool = False) pystac.extensions.timestamps.SummariesTimestampsExtension[source]#

Returns the extended summaries object for the given collection.

property unpublished: Optional[datetime.datetime]#

Gets or sets a datetime object that represents the date and time the corresponding data was unpublished.

‘Unpublished’ has a different meaning depending on where it is used. If available in the asset properties, it refers to the timestamps valid for the actual data linked to the Asset Object. If it comes from the Item properties, it’s referencing to the timestamp valid for the metadata.

class pystac.extensions.timestamps.TimestampsExtensionHooks[source]#

Bases: pystac.extensions.hooks.ExtensionHooks

prev_extension_ids = {'timestamps'}#
schema_uri: str = 'https://stac-extensions.github.io/timestamps/v1.0.0/schema.json'#
stac_object_types = {STACObjectType.ITEM}#