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

Defines a range of STAC versions.

pystac.serialization.identify_stac_object(json_dict: dict[str, Any]) 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]) 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


json_dict – The dict of JSON to identify.

pystac.serialization.merge_common_properties(item_dict: dict[str, Any], collection_cache: CollectionCache | None = None, json_href: str | None = 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: 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: