Skip to content

Commit 20ecd0a

Browse files
authored
Merge pull request #44 from GlobalFishingWatch/feature/bulk-downloads-resource
implement Bulk Download API resource and client integration
2 parents b9162b1 + b805062 commit 20ecd0a

File tree

11 files changed

+699
-18
lines changed

11 files changed

+699
-18
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ The Global Fishing Watch Python package currently works with the following APIs:
3939

4040
- [Datasets API](https://globalfishingwatch.org/our-apis/documentation#datasets-api): Retrieve fixed offshore infrastructure detections (e.g., oil platforms, wind farms) from Sentinel-1 and Sentinel-2 satellite imagery, from 2017 up to 3 months ago, classified using deep learning.
4141

42+
- [Bulk Download API](https://globalfishingwatch.org/our-apis/documentation#bulk-download-api): Efficiently access and download large-scale datasets to integrate with big data platforms and tools used by data engineers and researchers. Unlike our other APIs ([Map Visualization (4Wings API)](https://globalfishingwatch.org/our-apis/documentation#map-visualization-4wings-api), [Datasets API](https://globalfishingwatch.org/our-apis/documentation#datasets-api) etc.), these datasets may include some **noisy** that are not filtered out.
43+
4244
- [References API](https://globalfishingwatch.org/our-apis/documentation#regions): Access metadata for EEZs, MPAs, and RFMOs to use in [Events API](https://globalfishingwatch.org/our-apis/documentation#events-api) and [Map Visualization (4Wings API)](https://globalfishingwatch.org/our-apis/documentation#map-visualization-4wings-api) requests and analyses.
4345

4446
> **Note:** See the [Data Caveats](https://globalfishingwatch.org/our-apis/documentation#data-caveat) and [Terms of Use](https://globalfishingwatch.org/our-apis/documentation#terms-of-use) pages in the [GFW API documentation](https://globalfishingwatch.org/our-apis/documentation#introduction) for details on GFW data, API licenses, and rate limits.

src/gfwapiclient/__init__.py

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,52 @@
11
"""Global Fishing Watch (GFW) API Python Client.
22
3-
This package provides a Python client for interacting with the Global Fishing Watch (GFW) API,
4-
specifically `version 3 <https://globalfishingwatch.org/our-apis/documentation#version-3-api>`_.
5-
It enables access to publicly available API resources, and facilitating the retrieval of the data.
3+
This package provides a Python client for interacting with the Global Fishing Watch
4+
(GFW) API version 3.
65
7-
Features:
6+
See: https://globalfishingwatch.org/our-apis/documentation#version-3-api
87
9-
- **4Wings**: Access AIS apparent fishing effort, AIS vessel presence, and SAR vessel detections between 2017 to ~5 days ago.
8+
See: https://globalfishingwatch.org/our-apis/documentation#in-api-version-3
109
11-
- **Vessels**: Search and retrieve vessel identity based on AIS self-reported data, combined with authorization and registry data from regional and national registries.
10+
It enables access to publicly available API resources, and facilitating the retrieval
11+
of the following APIs data:
1212
13-
- **Events**: Retrieve vessel activity events such as encounters, loitering, port visits, fishing events, and AIS off (aka GAPs).
13+
- **Map Visualization (4Wings API)**: Access AIS apparent fishing effort,
14+
AIS vessel presence, and SAR vessel detections between 2017 to ~5 days ago.
1415
15-
- **Insights**: Access vessel insights that combine AIS activity, vessel identity, and public authorizations. Designed to support risk-based decision-making, operational planning, and due diligence—particularly for assessing risks of IUU (Illegal, Unreported, or Unregulated) fishing.
16+
- **Vessels API**: Search and retrieve vessel identity based on AIS self-reported data,
17+
combined with authorization and registry data from regional and national registries.
1618
17-
- **Datasets**: Retrieve fixed offshore infrastructure detections (e.g., oil platforms, wind farms) from Sentinel-1 and Sentinel-2 satellite imagery, from 2017 up to 3 months ago, classified using deep learning.
19+
- **Events API**: Retrieve vessel activity events such as encounters, loitering, port
20+
visits, fishing events, and AIS off (aka GAPs).
1821
19-
- **References**: Access metadata for EEZs, MPAs, and RFMOs to use in `Events API <https://globalfishingwatch.org/our-apis/documentation#events-api>`_ and `Map Visualization (4Wings API) <https://globalfishingwatch.org/our-apis/documentation#map-visualization-4wings-api>`_ requests and analyses.
22+
- **Insights API**: Access vessel insights that combine AIS activity, vessel identity,
23+
and public authorizations. Designed to support risk-based decision-making, operational
24+
planning, and due diligence—particularly for assessing risks of
25+
IUU (Illegal, Unreported, or Unregulated) fishing.
2026
21-
For comprehensive details, please refer to the official
22-
`Global Fishing Watch API Documentation <https://globalfishingwatch.org/our-apis/documentation#version-3-api>`_.
27+
- **Datasets API**: Retrieve fixed offshore infrastructure detections (e.g.,
28+
oil platforms, wind farms etc.) from Sentinel-1 and Sentinel-2 satellite imagery,
29+
from 2017 up to 3 months ago, classified using deep learning.
30+
31+
- **Bulk Download API**: Efficiently access and download large-scale datasets to
32+
integrate with big data platforms and tools used by data engineers and researchers.
33+
Unlike our other APIs (4Wings API, Datasets API, etc.), these datasets may include
34+
some **noisy** that are not filtered out.
35+
36+
- **References**: Access metadata for EEZs, MPAs, and RFMOs to use in Events API and
37+
4Wings API requests and analyses.
38+
39+
For more details on the data, API licenses, and rate limits, please refer to
40+
the official Global Fishing Watch API documentation:
41+
42+
See: https://globalfishingwatch.org/our-apis/documentation#introduction
43+
44+
For more details on the data caveats and terms of use, please refer to the
45+
official Global Fishing Watch API documentation:
46+
47+
See: https://globalfishingwatch.org/our-apis/documentation#data-caveat
48+
49+
See: https://globalfishingwatch.org/our-apis/documentation#terms-of-use
2350
"""
2451

2552
from gfwapiclient.__version__ import __version__

src/gfwapiclient/client/client.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from gfwapiclient.http import HTTPClient
1010
from gfwapiclient.resources import (
11+
BulkDownloadResource,
1112
DatasetResource,
1213
EventResource,
1314
FourWingsResource,
@@ -55,6 +56,9 @@ class Client:
5556
datasets (DatasetResource):
5657
Access to the datasets data resources.
5758
59+
bulk_downloads (BulkDownloadResource):
60+
Access to the Bulk download API resources.
61+
5862
references (ReferenceResource):
5963
Access to the reference data resources.
6064
"""
@@ -64,6 +68,7 @@ class Client:
6468
_events: EventResource
6569
_insights: InsightResource
6670
_datasets: DatasetResource
71+
_bulk_downloads: BulkDownloadResource
6772
_references: ReferenceResource
6873

6974
def __init__(
@@ -245,6 +250,26 @@ def datasets(self) -> DatasetResource:
245250
self._datasets = DatasetResource(http_client=self._http_client)
246251
return self._datasets
247252

253+
@property
254+
def bulk_downloads(self) -> BulkDownloadResource:
255+
"""Bulk download API resource.
256+
257+
Provides access to the Bulk Download API resources, which allow to
258+
efficiently create, retrieve, and download bulk reports data and files.
259+
260+
For more details on the Bulk Download API, please refer to the official
261+
Global Fishing Watch API documentation:
262+
263+
See: https://globalfishingwatch.org/our-apis/documentation#bulk-download-api
264+
265+
Returns:
266+
BulkDownloadResource:
267+
The bulk download resource instance.
268+
"""
269+
if not hasattr(self, "_bulk_downloads"):
270+
self._bulk_downloads = BulkDownloadResource(http_client=self._http_client)
271+
return self._bulk_downloads
272+
248273
@property
249274
def references(self) -> ReferenceResource:
250275
"""References data API resource.

src/gfwapiclient/resources/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Global Fishing Watch (GFW) API Python Client - Resources."""
22

3+
from gfwapiclient.resources.bulk_downloads import BulkDownloadResource
34
from gfwapiclient.resources.datasets import DatasetResource
45
from gfwapiclient.resources.events import EventResource
56
from gfwapiclient.resources.fourwings import FourWingsResource
@@ -9,6 +10,7 @@
910

1011

1112
__all__ = [
13+
"BulkDownloadResource",
1214
"DatasetResource",
1315
"EventResource",
1416
"FourWingsResource",

src/gfwapiclient/resources/bulk_downloads/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@
1919
2020
See: https://globalfishingwatch.org/our-apis/documentation#sar-fixed-infrastructure-data-caveats
2121
"""
22+
23+
from gfwapiclient.resources.bulk_downloads.resources import BulkDownloadResource
24+
25+
26+
__all__ = ["BulkDownloadResource"]

0 commit comments

Comments
 (0)