pystac.serialization.identify#
- class pystac.serialization.identify.OldExtensionShortIDs(value)[source]
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])[source]
Describes the STAC object information for a STAC object represented in JSON
- object_type
Describes the STAC object type. One of
STACObjectType
.- Type:
- version_range
The STAC version range that describes what has been identified as potential valid versions of the stac object.
- Type:
- object_type: STACObjectType
- version_range: STACVersionRange
- class pystac.serialization.identify.STACVersionID(version_string: str)[source]
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_string: str
- class pystac.serialization.identify.STACVersionRange(min_version: str | STACVersionID = '0.8.0', max_version: str | STACVersionID | None = None)[source]
Defines a range of STAC versions.
- latest_valid_version() STACVersionID [source]
- max_version: STACVersionID
- min_version: STACVersionID
- pystac.serialization.identify.identify_stac_object(json_dict: dict[str, Any]) STACJSONDescription [source]
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 [source]
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.