pystac.extensions.scientific#

Implements the Scientific Citation Extension.

For a description of Digital Object Identifiers (DOIs), see the DOI Handbook:

https://doi.org/10.1000/182

class pystac.extensions.scientific.CollectionScientificExtension(collection: Collection)[source]#

A concrete implementation of ScientificExtension on an Collection that extends the properties of the Item to include properties defined in the Scientific Citation Extension.

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

collection: pystac.Collection#

The Collection being extended.

The list of Link objects associated with the Collection being extended, including links added by this extension.

properties: dict[str, Any]#

The Collection properties, including extension properties.

class pystac.extensions.scientific.ItemScientificExtension(item: Item)[source]#

A concrete implementation of ScientificExtension on an Item that extends the properties of the Item to include properties defined in the Scientific Citation Extension.

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

item: pystac.Item#

The Item being extended.

The list of Link objects associated with the Item being extended, including links added by this extension.

properties: dict[str, Any]#

The Item properties, including extension properties.

class pystac.extensions.scientific.Publication(doi: str | None, citation: str | None)[source]#

Helper for Publication entries.

citation: str | None#
doi: str | None#
static from_dict(d: dict[str, str]) Publication[source]#

Gets a Link for the DOI for this publication. If Publication.doi is None, this method will also return None.

to_dict() dict[str, str | None][source]#
class pystac.extensions.scientific.ScientificExtension(obj: STACObject)[source]#

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

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

>>> item: pystac.Item = ...
>>> sci_ext = ScientificExtension.ext(item)
apply(doi: str | None = None, citation: str | None = None, publications: list[Publication] | None = None) None[source]#

Applies scientific extension properties to the extended Item.

Parameters:
  • doi – Optional DOI string for the item. Must not be a DOI link.

  • citation – Optional human-readable reference.

  • publications – Optional list of relevant publications referencing and describing the data.

property citation: str | None#

Get or sets the recommended human-readable reference (citation) to be used by publications citing the data.

No specific citation style is suggested, but the citation should contain all information required to find the publication distinctively.

property doi: str | None#

Get or sets the DOI for the item.

This MUST NOT be a DOIs link. For all DOI names respective DOI links SHOULD be added to the links section.

classmethod ext(obj: T, add_if_missing: bool = False) ScientificExtension[T][source]#

Extends the given STAC Object with properties from the Scientific Extension.

This extension can be applied to instances of Item or Collection.

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['sci'] = 'sci'#
obj: pystac.STACObject#
property publications: list[Publication] | None#

Get or sets the list of relevant publications referencing and describing the data.

remove_publication(publication: Publication | None = None) None[source]#

Removes the given Publication from the extended Item. If the publication argument is None, all publications will be removed from the Item.

classmethod summaries(obj: Collection, add_if_missing: bool = False) SummariesScientificExtension[source]#

Returns the extended summaries object for the given collection.

class pystac.extensions.scientific.ScientificExtensionHooks[source]#
prev_extension_ids = {'scientific'}#
schema_uri: str = 'https://stac-extensions.github.io/scientific/v1.0.0/schema.json'#
stac_object_types = {STACObjectType.COLLECTION, STACObjectType.ITEM}#
class pystac.extensions.scientific.ScientificRelType(value)[source]#

A list of rel types defined in the Scientific Citation Extension.

See the Scientific Citation Extension Relation types documentation for details.

CITE_AS = 'cite-as'#

Used to indicate a link to the publication referenced by the sci:doi field.

class pystac.extensions.scientific.SummariesScientificExtension(collection: Collection)[source]#

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

property citation: list[str] | None#

Get or sets the summary of ScientificExtension.citation values for this Collection.

property doi: list[str] | None#

Get or sets the summary of ScientificExtension.citation values for this Collection.

summaries: Summaries#

The summaries for the Collection being extended.

pystac.extensions.scientific.doi_to_url(doi: str) str[source]#

Converts a DOI to the corresponding URL.