Skip to content

Module stac_fastapi.pgstac.utils

stac-fastapi utility methods.

Functions

dict_deep_update

def dict_deep_update(
    merge_to: Dict[str, Any],
    merge_from: Dict[str, Any]
) -> None

Perform a deep update of two dicts.

merge_to is updated in-place with the values from merge_from. merge_from values take precedence over existing values in merge_to.

filter_fields

def filter_fields(
    item: Union[stac_fastapi.types.stac.Item, Dict[str, Any]],
    include: Optional[Set[str]] = None,
    exclude: Optional[Set[str]] = None
) -> stac_fastapi.types.stac.Item

Preserve and remove fields as indicated by the fields extension include/exclude sets.

Returns a shallow copy of the Item with the fields filtered.

This will not perform a deep copy; values of the original item will be referenced in the return item.