Skip to main content
`Ctrl`+`K`

# pystac.serialization.identify

class pystac.serialization.identify.STACVersionRange(min_version: str | STACVersionID = '0.8.0', max_version: str | STACVersionID | None = None)

  Defines a range of STAC versions.

  contains(v: str | STACVersionID) → bool
  is_earlier_than(v: str | STACVersionID) → bool
  is_later_than(v: str | STACVersionID) → bool
  is_single_version() → bool
  latest_valid_version() → STACVersionID
  property max_version: STACVersionID
  property min_version: STACVersionID
  set_max(v: str | STACVersionID) → None
  set_min(v: str | STACVersionID) → None
  set_to_single(v: str | STACVersionID) → None

pystac.serialization.identify.identify_stac_object(json_dict: dict[str, Any]) → STACJSONDescription

  Determines the STACJSONDescription of the provided JSON dict.

  Parameters:

    json_dict – The dict of STAC JSON to identify.

  Returns:

    The description of the STAC object serialized in the given dict.

  Return type:

    STACJSONDescription

pystac.serialization.identify.identify_stac_object_type(json_dict: dict[str, Any]) → STACObjectType | None

  Determines the STACObjectType of the provided JSON dict. If the JSON dict does not represent a STAC object, returns `None`.

  Will first try to identify the object using `"type"` field as described in the guidelines in How to Differentiate STAC Files. If this fails, will fall back to using the pre-1.0 heuristic described in this issue

  Parameters:

    json_dict – The dict of JSON to identify.

class pystac.serialization.identify.STACVersionRange(min_version: str | STACVersionID = '0.8.0', max_version: str | STACVersionID | None = None)

  Defines a range of STAC versions.

  contains(v: str | STACVersionID) → bool
  is_earlier_than(v: str | STACVersionID) → bool
  is_later_than(v: str | STACVersionID) → bool
  is_single_version() → bool
  latest_valid_version() → STACVersionID
  property max_version: STACVersionID
  property min_version: STACVersionID
  set_max(v: str | STACVersionID) → None
  set_min(v: str | STACVersionID) → None
  set_to_single(v: str | STACVersionID) → None

class pystac.serialization.identify.OldExtensionShortIDs(*values)

  Enumerates the IDs of common extensions.

  CHECKSUM = 'checksum'
  COLLECTION_ASSETS = 'collection-assets'
  DATACUBE = 'datacube'
  EO = 'eo'
  FILE = 'file'
  ITEM_ASSETS = 'item-assets'
  LABEL = 'label'
  POINTCLOUD = 'pointcloud'
  PROJECTION = 'projection'
  SAR = 'sar'
  SAT = 'sat'
  SCIENTIFIC = 'scientific'
  SINGLE_FILE_STAC = 'single-file-stac'
  TILED_ASSETS = 'tiled-assets'
  TIMESTAMPS = 'timestamps'
  VERSION = 'version'
  VIEW = 'view'

class pystac.serialization.identify.STACJSONDescription(object_type: STACObjectType, version_range: STACVersionRange, extensions: list[str])

  Describes the STAC object information for a STAC object represented in JSON

  Parameters:

    - object_type – Describes the STAC object type. One of `STACObjectType`.

    - version_range – The STAC version range that describes what has been identified as potential valid versions of the stac object.

    - extensions – List of extension schema URIs for extensions this object implements

  extensions: list[str]

    List of extension schema URIs for extensions this object implements

  object_type: STACObjectType

    Describes the STAC object type. One of `STACObjectType`.

  version_range: STACVersionRange

    The STAC version range that describes what has been identified as potential valid versions of the `STACObject`.

class pystac.serialization.identify.STACVersionID(version_string: str)

  Defines STAC versions in an object that is orderable based on version number. For instance, `1.0.0-beta.2 < 1.0.0`

  version_core: str
  version_prerelease: str | None
  version_string: str