gfwapiclient.resources.bulk_downloads.query.endpoints¶
Global Fishing Watch (GFW) API Python Client - Query Bulk Report API endpoints.
Module Contents¶
Classes¶
Query Bulk Report API endpoint. |
|
Query Bulk fixed infrastructure data API endpoint. |
Data¶
API¶
- gfwapiclient.resources.bulk_downloads.query.endpoints.__all__ = ['BulkFixedInfrastructureDataQueryEndPoint', 'BulkReportQueryEndPoint']¶
- class gfwapiclient.resources.bulk_downloads.query.endpoints.BulkReportQueryEndPoint(*, bulk_report_id: str, request_params: gfwapiclient.resources.bulk_downloads.query.models.base.request.BulkReportQueryParams, result_item_class: Type[gfwapiclient.resources.bulk_downloads.query.models.base.response._BulkReportQueryItemT], result_class: Type[gfwapiclient.resources.bulk_downloads.query.models.base.response._BulkReportQueryResultT], http_client: gfwapiclient.http.client.HTTPClient)¶
Bases:
gfwapiclient.http.endpoints.GetEndPoint[gfwapiclient.resources.bulk_downloads.query.models.base.request.BulkReportQueryParams,gfwapiclient.http.models.RequestBody,gfwapiclient.resources.bulk_downloads.query.models.base.response._BulkReportQueryItemT,gfwapiclient.resources.bulk_downloads.query.models.base.response._BulkReportQueryResultT]Query Bulk Report API endpoint.
This endpoint query the previously created bulk report data in JSON format based on the provided request parameters.
For more details on the Query Bulk Report API endpoint, please refer to the official Global Fishing Watch API documentation:
See: https://globalfishingwatch.org/our-apis/documentation#get-data-in-json-format
Initialization
Initializes a new BulkReportQueryEndPoint.
- Args:
- bulk_report_id (str):
Unique identifier (ID) of the bulk report.
- request_params (BulkReportQueryParams):
The request parameters.
- result_item_class (Type[_BulkReportQueryItemT]):
Pydantic model for the expected response item.
- result_class (Type[_BulkReportQueryResultT]):
Pydantic model for the expected response result.
- http_client (HTTPClient):
The HTTP client used to make the API call.
- _transform_response_data(*, body: Union[List[Dict[str, Any]], Dict[str, Any]]) Union[List[Dict[str, Any]], Dict[str, Any]]¶
Transform and reshape response body and yield data.
This method transforms the raw response body from the API into a format suitable for the BulkReportQueryResult model.
The expected response structure is: {“entries”: [{…}]}.
- Args:
- body (Union[List[Dict[str, Any]], Dict[str, Any]]):
The raw response body.
- Returns:
- Union[List[Dict[str, Any]], Dict[str, Any]]:
The transformed response data.
- Raises:
- ResultValidationError:
If the response body does not match the expected format.
- class gfwapiclient.resources.bulk_downloads.query.endpoints.BulkFixedInfrastructureDataQueryEndPoint(*, bulk_report_id: str, request_params: gfwapiclient.resources.bulk_downloads.query.models.base.request.BulkReportQueryParams, http_client: gfwapiclient.http.client.HTTPClient)¶
Bases:
gfwapiclient.resources.bulk_downloads.query.endpoints.BulkReportQueryEndPoint[gfwapiclient.resources.bulk_downloads.query.models.fixed_infrastructure_data.response.BulkFixedInfrastructureDataQueryItem,gfwapiclient.resources.bulk_downloads.query.models.fixed_infrastructure_data.response.BulkFixedInfrastructureDataQueryResult]Query Bulk fixed infrastructure data API endpoint.
This endpoint query the previously created fixed infrastructure data (i.e., public-fixed-infrastructure-data:latest dataset) bulk report data in JSON format based on the provided request parameters.
For more details on the Query Bulk Report API endpoint, please refer to the official Global Fishing Watch API documentation:
See: https://globalfishingwatch.org/our-apis/documentation#get-data-in-json-format
Initialization
Initializes a new BulkFixedInfrastructureDataQueryEndPoint.
- Args:
- bulk_report_id (str):
Unique identifier (ID) of the bulk report.
- request_params (BulkReportQueryParams):
The request parameters.
- http_client (HTTPClient):
The HTTP client used to make the API call.