pystac.extensions.timestamps#

Implements the Timestamps Extension.

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

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: 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.timestamps.ItemTimestampsExtension(item: Item)[source]#

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#

The Item being extended.

properties: dict[str, Any]#

The Item properties, including extension properties.

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

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

property expires: RangeSummary[datetime] | None#

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

property published: RangeSummary[datetime] | None#

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

summaries: Summaries#

The summaries for the Collection being extended.

property unpublished: RangeSummary[datetime] | None#

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

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

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: datetime | None = None, expires: datetime | None = None, unpublished: datetime | None = 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: datetime | None#

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: T, add_if_missing: bool = False) TimestampsExtension[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.

name: Literal['timestamps'] = 'timestamps'#
property published: datetime | None#

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: Collection, add_if_missing: bool = False) SummariesTimestampsExtension[source]#

Returns the extended summaries object for the given collection.

property unpublished: datetime | None#

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]#
prev_extension_ids = {'https://stac-extensions.github.io/timestamps/v1.0.0/schema.json', 'timestamps'}#
schema_uri: str = 'https://stac-extensions.github.io/timestamps/v1.1.0/schema.json'#
stac_object_types = {STACObjectType.ITEM}#