gfwapiclient.resources.insights.resources

Global Fishing Watch (GFW) API Python Client - Vessels Insights API Resource.

Module Contents

Classes

InsightResource

Insights data API resource.

Data

API

gfwapiclient.resources.insights.resources.__all__ = ['InsightResource']
class gfwapiclient.resources.insights.resources.InsightResource(*, http_client: gfwapiclient.http.client.HTTPClient)

Bases: gfwapiclient.http.resources.BaseResource

Insights data API resource.

This resource provides methods to interact with the insights data API endpoints.

Initialization

Initialize a new BaseResource.

Args:
http_client (HTTPClient):

The HTTP client to send requests.

async get_vessel_insights(*, includes: Union[List[gfwapiclient.resources.insights.models.request.VesselInsightInclude], List[str]], start_date: Union[datetime.date, str], end_date: Union[datetime.date, str], vessels: Union[List[gfwapiclient.resources.insights.models.request.VesselInsightDatasetVessel], List[Dict[str, Any]]], **kwargs: Dict[str, Any]) gfwapiclient.resources.insights.models.response.VesselInsightResult

Get vessels insights data.

Retrieves insights data for specified vessels based on the provided request parameters.

Args:
includes (Union[List[VesselInsightInclude], List[str]]):

List of insight types to include in the response. Allowed values are “FISHING”, “GAP”, “COVERAGE”, “IDENTITY”. Example: [“FISHING”, “GAP”].

start_date (Union[datetime.date, str]):

The start date for the insights period. Format: “YYYY-MM-DD” or datetime.date object. Example: “2020-01-01” or datetime.date(2020, 1, 1).

end_date (Union[datetime.date, str]):

The end date for the insights period. Format: “YYYY-MM-DD” or datetime.date object. Example: “2025-03-03” or datetime.date(2025, 3, 3).

vessels (Union[List[VesselInsightDatasetVessel], List[Dict[str, Any]]]):

List of vessel identifiers to retrieve insights for. Example: `[{“vessel_id”: “785101812-2127-e5d2-e8bf-7152c5259f5f”,

“dataset_id”: “public-global-vessel-identity:latest”,}]`.

**kwargs (Dict[str, Any]):

Additional keyword arguments.

Returns:
VesselInsightResult:

The vessel insights result.

Raises:
GFWAPIClientError:

If the API request fails.

RequestBodyValidationError:

If the request body is invalid.

_prepare_get_vessel_insights_request_body(*, includes: Union[List[gfwapiclient.resources.insights.models.request.VesselInsightInclude], List[str]], start_date: Union[datetime.date, str], end_date: Union[datetime.date, str], vessels: Union[List[gfwapiclient.resources.insights.models.request.VesselInsightDatasetVessel], List[Dict[str, Any]]], **kwargs: Dict[str, Any]) gfwapiclient.resources.insights.models.request.VesselInsightBody

Prepare and returns get vessel insights request body.