pystac.serialization.identify#

class pystac.serialization.identify.OldExtensionShortIDs(value)[source]

Bases: enum.Enum

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_Type, version_range: pystac.serialization.identify.STACVersionRange, extensions: Set[str])[source]

Bases: object

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

object_type

Describes the STAC object type. One of STACObjectType.

Type

STACObjectType_Type

version_range

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

Type

pystac.serialization.identify.STACVersionRange

extensions

List of extension schema URIs for extensions this object implements

Type

Set[str]

extensions: Set[str]
object_type: STACObjectType_Type
version_range: pystac.serialization.identify.STACVersionRange
class pystac.serialization.identify.STACVersionID(version_string: str)[source]

Bases: object

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: Optional[str]
version_string: str
class pystac.serialization.identify.STACVersionRange(min_version: Union[str, pystac.serialization.identify.STACVersionID] = '0.8.0', max_version: Optional[Union[str, pystac.serialization.identify.STACVersionID]] = None)[source]

Bases: object

Defines a range of STAC versions.

contains(v: Union[str, pystac.serialization.identify.STACVersionID]) bool[source]
is_earlier_than(v: Union[str, pystac.serialization.identify.STACVersionID]) bool[source]
is_later_than(v: Union[str, pystac.serialization.identify.STACVersionID]) bool[source]
is_single_version() bool[source]
latest_valid_version() pystac.serialization.identify.STACVersionID[source]
max_version: pystac.serialization.identify.STACVersionID
min_version: pystac.serialization.identify.STACVersionID
set_max(v: pystac.serialization.identify.STACVersionID) None[source]
set_min(v: pystac.serialization.identify.STACVersionID) None[source]
set_to_single(v: pystac.serialization.identify.STACVersionID) None[source]
pystac.serialization.identify.identify_stac_object(json_dict: Dict[str, Any]) pystac.serialization.identify.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]) Optional[STACObjectType_Type][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.