pystac.extensions.timestamps#
Implements the Timestamps Extension.
- class pystac.extensions.timestamps.AssetTimestampsExtension(asset: Asset)[source]#
A concrete implementation of
TimestampsExtensionon anAssetthat 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 anAssetto extend it.
- class pystac.extensions.timestamps.ItemTimestampsExtension(item: Item)[source]#
A concrete implementation of
TimestampsExtensionon anItemthat 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 anItemto extend it.
- class pystac.extensions.timestamps.SummariesTimestampsExtension(collection: Collection)[source]#
A concrete implementation of
SummariesExtensionthat extends thesummariesfield of aCollectionto include properties defined in the Timestamps Extension.- property expires: RangeSummary[datetime] | None#
Get or sets the summary of
TimestampsExtension.expiresvalues for this Collection.
- property published: RangeSummary[datetime] | None#
Get or sets the summary of
TimestampsExtension.publishedvalues for this Collection.
- property unpublished: RangeSummary[datetime] | None#
Get or sets the summary of
TimestampsExtension.unpublishedvalues for this Collection.
- class pystac.extensions.timestamps.T#
Generalized version of
Collection,Item, orAssetalias of TypeVar(‘T’, ~pystac.collection.Collection, ~pystac.item.Item, ~pystac.asset.Asset)
- class pystac.extensions.timestamps.TimestampsExtension[source]#
An abstract class that can be used to extend the properties of an
ItemorAssetwith 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 theTimestampsExtension.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
ItemorAsset.- Raises:
pystac.ExtensionTypeError – If an invalid object type is passed.
- 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.