Skip to content

utils

stac_fastapi.pgstac.utils

stac-fastapi utility methods.

dict_deep_update

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

filter_fields(
    item: Union[Item, Dict[str, Any]],
    include: Optional[Set[str]] = None,
    exclude: Optional[Set[str]] = None,
) -> 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.