pystac.extensions.timestamps#
Implements the Timestamps Extension.
- class pystac.extensions.timestamps.AssetTimestampsExtension(asset: Asset)[source]#
A concrete implementation of
TimestampsExtension
on anAsset
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 anAsset
to extend it.
- class pystac.extensions.timestamps.ItemTimestampsExtension(item: Item)[source]#
A concrete implementation of
TimestampsExtension
on anItem
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 anItem
to extend it.- item: pystac.Item#
The
Item
being extended.
- class pystac.extensions.timestamps.SummariesTimestampsExtension(collection: Collection)[source]#
A concrete implementation of
SummariesExtension
that extends thesummaries
field of aCollection
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
orAsset
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 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
Item
orAsset
.- 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.