Skip to content

Module stac_fastapi.extensions.core.aggregation

Aggregation extension module.

Sub-modules

Classes

AggregationExtension

class AggregationExtension(
    schema_href: Optional[str] = None,
    client: Union[stac_fastapi.extensions.core.aggregation.client.AsyncBaseAggregationClient, stac_fastapi.extensions.core.aggregation.client.BaseAggregationClient] = NOTHING,
    conformance_classes: List[str] = [<AggregationConformanceClasses.AGGREGATION: 'https://api.stacspec.org/v0.3.0/aggregation'>],
    router: fastapi.routing.APIRouter = NOTHING
)

Aggregation Extension.

The purpose of the Aggregation Extension is to provide an endpoint similar to the Search endpoint (/search), but which will provide aggregated information on matching Items rather than the Items themselves. This is highly influenced by the Elasticsearch and OpenSearch aggregation endpoint, but with a more regular structure for responses.

The Aggregation extension adds several endpoints which allow the retrieval of available aggregation fields and aggregation buckets based on a seearch query: GET /aggregations POST /aggregations GET /collections/{collection_id}/aggregations POST /collections/{collection_id}/aggregations GET /aggregate POST /aggregate GET /collections/{collection_id}/aggregate POST /collections/{collection_id}/aggregate

github.com/stac-api-extensions/aggregation/blob/main/README.md

Attributes

Name Type Description Default
conformance_classes None Conformance classes provided by the extension None

Ancestors (in MRO)

  • stac_fastapi.types.extension.ApiExtension
  • abc.ABC

Class variables

GET
POST

Methods

get_request_model

def get_request_model(
    self,
    verb: Optional[str] = 'GET'
) -> Optional[pydantic.main.BaseModel]

Return the request model for the extension.method.

The model can differ based on HTTP verb

register

def register(
    self,
    app: fastapi.applications.FastAPI
) -> None

Register the extension with a FastAPI application.

Parameters:

Name Type Description Default
app None target FastAPI application. None

Returns:

Type Description
None None