class pystac.serialization.STACVersionRange(min_version: Union[str, pystac.serialization.identify.STACVersionID] = '0.8.0', max_version: Optional[Union[str, pystac.serialization.identify.STACVersionID]] = None)[source]#

Defines a range of STAC versions.

pystac.serialization.identify_stac_object(json_dict: Dict[str, Any]) pystac.serialization.identify.STACJSONDescription[source]#

Determines the STACJSONDescription of the provided JSON dict.


json_dict – The dict of STAC JSON to identify.


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

Return type


pystac.serialization.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


json_dict – The dict of JSON to identify.

pystac.serialization.merge_common_properties(item_dict: Dict[str, Any], collection_cache: Optional[pystac.cache.CollectionCache] = None, json_href: Optional[str] = None) bool[source]#

Merges Collection properties into an Item.

Note: This is only applicable to reading old STAC versions (pre 1.0.0-beta.1).

  • item_dict – JSON dict of the Item which properties should be merged into.

  • collection_cache – Optional CollectionCache that will be used to read and write cached collections.

  • json_href – The HREF of the file that this JSON comes from. Used to resolve relative paths.


True if Collection properties have been merged, otherwise False.

Return type


pystac.serialization.migrate_to_latest(json_dict: Dict[str, Any], info: pystac.serialization.identify.STACJSONDescription) Dict[str, Any][source]#

Migrates the STAC JSON to the latest version

  • json_dict – The dict of STAC JSON to identify.

  • info – The info from identify_stac_object() that describes the STAC object contained in the JSON dict.


A copy of the dict that is migrated to the latest version (the version that is pystac.version.STACVersion.DEFAULT_STAC_VERSION)

Return type