\n",
" \n",
" | 0 | \n",
- " 2025-12-21 22:54:19+00:00 | \n",
- " 2025-12-22 01:59:26+00:00 | \n",
- " 20722d55b7a106978e2b55e65f7affa6 | \n",
+ " 2022-10-10 15:49:06+00:00 | \n",
+ " 2022-10-10 18:27:46+00:00 | \n",
+ " da35d28bfc433f251fe03c2ded3a5e23 | \n",
" fishing | \n",
- " {'lat': -45.734, 'lon': -60.6275} | \n",
- " {'mpa': [], 'eez': [], 'rfmo': ['ICCAT', 'IWC'... | \n",
- " [-60.638205, -45.736243333333334, -60.622215, ... | \n",
- " {'start_distance_from_shore_km': 390.0, 'end_d... | \n",
- " {'id': '755a48dd4-4bee-4bcf-7b5f-9baea058fc7b'... | \n",
+ " {'lat': 42.9677, 'lon': 156.9126} | \n",
+ " {'mpa': [], 'eez': [], 'rfmo': ['ACAP', 'NPFC'... | \n",
+ " [156.90262, 42.93749, 156.92824, 42.979495] | \n",
+ " {'start_distance_from_shore_km': 585.0, 'end_d... | \n",
+ " {'id': '3dad49b0b-b2e0-9347-0c4c-e39fea560f9f'... | \n",
" None | \n",
- " {'total_distance_km': 1.553408717842079, 'aver... | \n",
+ " {'total_distance_km': 5.313381753510874, 'aver... | \n",
" None | \n",
" None | \n",
" None | \n",
"
\n",
" \n",
" | 1 | \n",
- " 2020-05-29 15:38:07+00:00 | \n",
- " 2020-05-29 19:22:03+00:00 | \n",
- " aa6f570aee327010bd4714aa6e459d08 | \n",
+ " 2022-10-08 23:28:16+00:00 | \n",
+ " 2022-10-09 04:06:15+00:00 | \n",
+ " 080bcd728a84f62fe901a3e5b02c6014 | \n",
" fishing | \n",
- " {'lat': 41.4151, 'lon': 165.5954} | \n",
- " {'mpa': [], 'eez': [], 'rfmo': ['NPAFC', 'PICE... | \n",
- " [165.58234666666667, 41.404185, 165.602265, 41... | \n",
- " {'start_distance_from_shore_km': 1213.0, 'end_... | \n",
+ " {'lat': 43.0665, 'lon': 156.4381} | \n",
+ " {'mpa': [], 'eez': [], 'rfmo': ['IWC', 'WCPFC'... | \n",
+ " [156.38127166666666, 43.05014166666667, 156.49... | \n",
+ " {'start_distance_from_shore_km': 549.0, 'end_d... | \n",
" {'id': '3dad49b0b-b2e0-9347-0c4c-e39fea560f9f'... | \n",
" None | \n",
- " {'total_distance_km': 3.2539329459390007, 'ave... | \n",
+ " {'total_distance_km': 10.200405590755741, 'ave... | \n",
" None | \n",
" None | \n",
" None | \n",
"
\n",
" \n",
" | 2 | \n",
- " 2025-12-31 23:00:02+00:00 | \n",
- " 2026-01-01 07:57:31+00:00 | \n",
- " 82ab07bcb2f0881dbdc2bea176f4d0eb | \n",
+ " 2022-10-30 23:36:05+00:00 | \n",
+ " 2022-10-31 11:25:45+00:00 | \n",
+ " c79bf8fbab9e58bb3b279bf757bae197 | \n",
" fishing | \n",
- " {'lat': -45.7853, 'lon': -60.6598} | \n",
- " {'mpa': [], 'eez': [], 'rfmo': ['ACAP', 'CCSBT... | \n",
- " [-60.66967666666667, -45.80526166666667, -60.6... | \n",
- " {'start_distance_from_shore_km': 390.0, 'end_d... | \n",
- " {'id': '755a48dd4-4bee-4bcf-7b5f-9baea058fc7b'... | \n",
+ " {'lat': 41.0574, 'lon': 149.7023} | \n",
+ " {'mpa': [], 'eez': ['48950'], 'rfmo': ['PICES'... | \n",
+ " [149.66486666666665, 40.94216166666667, 149.73... | \n",
+ " {'start_distance_from_shore_km': 392.0, 'end_d... | \n",
+ " {'id': '3dad49b0b-b2e0-9347-0c4c-e39fea560f9f'... | \n",
" None | \n",
- " {'total_distance_km': 5.18218418253593, 'avera... | \n",
+ " {'total_distance_km': 31.90361153133585, 'aver... | \n",
" None | \n",
" None | \n",
" None | \n",
"
\n",
" \n",
" | 3 | \n",
- " 2021-03-23 22:31:06+00:00 | \n",
- " 2021-03-24 06:45:12+00:00 | \n",
- " 634e0f958283315e9850e1523e6f7a88 | \n",
+ " 2021-02-21 23:05:34+00:00 | \n",
+ " 2021-02-22 08:36:32+00:00 | \n",
+ " 3cdbebbfbf2b7c926158fa6955eecb30 | \n",
" fishing | \n",
- " {'lat': -41.9474, 'lon': -57.9515} | \n",
- " {'mpa': [], 'eez': [], 'rfmo': ['ICCAT', 'IWC'... | \n",
- " [-57.89071, -41.96338333333333, -57.9833649999... | \n",
- " {'start_distance_from_shore_km': 377.0, 'end_d... | \n",
+ " {'lat': -45.8329, 'lon': -60.603} | \n",
+ " {'mpa': [], 'eez': [], 'rfmo': ['CCSBT', 'ICCA... | \n",
+ " [-60.5669816667, -45.836216666666665, -60.6110... | \n",
+ " {'start_distance_from_shore_km': 399.0, 'end_d... | \n",
" {'id': '3dad49b0b-b2e0-9347-0c4c-e39fea560f9f'... | \n",
" None | \n",
- " {'total_distance_km': 13.20298689870354, 'aver... | \n",
+ " {'total_distance_km': 5.725649380735478, 'aver... | \n",
" None | \n",
" None | \n",
" None | \n",
"
\n",
" \n",
" | 4 | \n",
- " 2022-06-17 12:52:22+00:00 | \n",
- " 2022-06-17 18:55:39+00:00 | \n",
- " 1c4ef3bc92b7a763c5f3b04d3a1a0779 | \n",
+ " 2020-05-26 16:43:39+00:00 | \n",
+ " 2020-05-26 18:25:46+00:00 | \n",
+ " 9b6a1c84d8daf3359a0d9917ff138d39 | \n",
" fishing | \n",
- " {'lat': 42.8639, 'lon': 168.4996} | \n",
- " {'mpa': [], 'eez': [], 'rfmo': ['WCPFC', 'NPAF... | \n",
- " [168.47266833333333, 42.858135, 168.5181933333... | \n",
- " {'start_distance_from_shore_km': 1122.0, 'end_... | \n",
+ " {'lat': 41.4176, 'lon': 165.3167} | \n",
+ " {'mpa': [], 'eez': [], 'rfmo': ['IWC', 'NPFC',... | \n",
+ " [165.315, 41.409706666666665, 165.31824, 41.42... | \n",
+ " {'start_distance_from_shore_km': 1198.0, 'end_... | \n",
" {'id': '3dad49b0b-b2e0-9347-0c4c-e39fea560f9f'... | \n",
" None | \n",
- " {'total_distance_km': 4.430991184550807, 'aver... | \n",
+ " {'total_distance_km': 2.3609454154613645, 'ave... | \n",
" None | \n",
" None | \n",
" None | \n",
@@ -1107,60 +1107,60 @@
],
"text/plain": [
" start end \\\n",
- "0 2025-12-21 22:54:19+00:00 2025-12-22 01:59:26+00:00 \n",
- "1 2020-05-29 15:38:07+00:00 2020-05-29 19:22:03+00:00 \n",
- "2 2025-12-31 23:00:02+00:00 2026-01-01 07:57:31+00:00 \n",
- "3 2021-03-23 22:31:06+00:00 2021-03-24 06:45:12+00:00 \n",
- "4 2022-06-17 12:52:22+00:00 2022-06-17 18:55:39+00:00 \n",
+ "0 2022-10-10 15:49:06+00:00 2022-10-10 18:27:46+00:00 \n",
+ "1 2022-10-08 23:28:16+00:00 2022-10-09 04:06:15+00:00 \n",
+ "2 2022-10-30 23:36:05+00:00 2022-10-31 11:25:45+00:00 \n",
+ "3 2021-02-21 23:05:34+00:00 2021-02-22 08:36:32+00:00 \n",
+ "4 2020-05-26 16:43:39+00:00 2020-05-26 18:25:46+00:00 \n",
"\n",
" id type \\\n",
- "0 20722d55b7a106978e2b55e65f7affa6 fishing \n",
- "1 aa6f570aee327010bd4714aa6e459d08 fishing \n",
- "2 82ab07bcb2f0881dbdc2bea176f4d0eb fishing \n",
- "3 634e0f958283315e9850e1523e6f7a88 fishing \n",
- "4 1c4ef3bc92b7a763c5f3b04d3a1a0779 fishing \n",
+ "0 da35d28bfc433f251fe03c2ded3a5e23 fishing \n",
+ "1 080bcd728a84f62fe901a3e5b02c6014 fishing \n",
+ "2 c79bf8fbab9e58bb3b279bf757bae197 fishing \n",
+ "3 3cdbebbfbf2b7c926158fa6955eecb30 fishing \n",
+ "4 9b6a1c84d8daf3359a0d9917ff138d39 fishing \n",
"\n",
- " position \\\n",
- "0 {'lat': -45.734, 'lon': -60.6275} \n",
- "1 {'lat': 41.4151, 'lon': 165.5954} \n",
- "2 {'lat': -45.7853, 'lon': -60.6598} \n",
- "3 {'lat': -41.9474, 'lon': -57.9515} \n",
- "4 {'lat': 42.8639, 'lon': 168.4996} \n",
+ " position \\\n",
+ "0 {'lat': 42.9677, 'lon': 156.9126} \n",
+ "1 {'lat': 43.0665, 'lon': 156.4381} \n",
+ "2 {'lat': 41.0574, 'lon': 149.7023} \n",
+ "3 {'lat': -45.8329, 'lon': -60.603} \n",
+ "4 {'lat': 41.4176, 'lon': 165.3167} \n",
"\n",
" regions \\\n",
- "0 {'mpa': [], 'eez': [], 'rfmo': ['ICCAT', 'IWC'... \n",
- "1 {'mpa': [], 'eez': [], 'rfmo': ['NPAFC', 'PICE... \n",
- "2 {'mpa': [], 'eez': [], 'rfmo': ['ACAP', 'CCSBT... \n",
- "3 {'mpa': [], 'eez': [], 'rfmo': ['ICCAT', 'IWC'... \n",
- "4 {'mpa': [], 'eez': [], 'rfmo': ['WCPFC', 'NPAF... \n",
+ "0 {'mpa': [], 'eez': [], 'rfmo': ['ACAP', 'NPFC'... \n",
+ "1 {'mpa': [], 'eez': [], 'rfmo': ['IWC', 'WCPFC'... \n",
+ "2 {'mpa': [], 'eez': ['48950'], 'rfmo': ['PICES'... \n",
+ "3 {'mpa': [], 'eez': [], 'rfmo': ['CCSBT', 'ICCA... \n",
+ "4 {'mpa': [], 'eez': [], 'rfmo': ['IWC', 'NPFC',... \n",
"\n",
" bounding_box \\\n",
- "0 [-60.638205, -45.736243333333334, -60.622215, ... \n",
- "1 [165.58234666666667, 41.404185, 165.602265, 41... \n",
- "2 [-60.66967666666667, -45.80526166666667, -60.6... \n",
- "3 [-57.89071, -41.96338333333333, -57.9833649999... \n",
- "4 [168.47266833333333, 42.858135, 168.5181933333... \n",
+ "0 [156.90262, 42.93749, 156.92824, 42.979495] \n",
+ "1 [156.38127166666666, 43.05014166666667, 156.49... \n",
+ "2 [149.66486666666665, 40.94216166666667, 149.73... \n",
+ "3 [-60.5669816667, -45.836216666666665, -60.6110... \n",
+ "4 [165.315, 41.409706666666665, 165.31824, 41.42... \n",
"\n",
" distances \\\n",
- "0 {'start_distance_from_shore_km': 390.0, 'end_d... \n",
- "1 {'start_distance_from_shore_km': 1213.0, 'end_... \n",
- "2 {'start_distance_from_shore_km': 390.0, 'end_d... \n",
- "3 {'start_distance_from_shore_km': 377.0, 'end_d... \n",
- "4 {'start_distance_from_shore_km': 1122.0, 'end_... \n",
+ "0 {'start_distance_from_shore_km': 585.0, 'end_d... \n",
+ "1 {'start_distance_from_shore_km': 549.0, 'end_d... \n",
+ "2 {'start_distance_from_shore_km': 392.0, 'end_d... \n",
+ "3 {'start_distance_from_shore_km': 399.0, 'end_d... \n",
+ "4 {'start_distance_from_shore_km': 1198.0, 'end_... \n",
"\n",
" vessel encounter \\\n",
- "0 {'id': '755a48dd4-4bee-4bcf-7b5f-9baea058fc7b'... None \n",
+ "0 {'id': '3dad49b0b-b2e0-9347-0c4c-e39fea560f9f'... None \n",
"1 {'id': '3dad49b0b-b2e0-9347-0c4c-e39fea560f9f'... None \n",
- "2 {'id': '755a48dd4-4bee-4bcf-7b5f-9baea058fc7b'... None \n",
+ "2 {'id': '3dad49b0b-b2e0-9347-0c4c-e39fea560f9f'... None \n",
"3 {'id': '3dad49b0b-b2e0-9347-0c4c-e39fea560f9f'... None \n",
"4 {'id': '3dad49b0b-b2e0-9347-0c4c-e39fea560f9f'... None \n",
"\n",
" fishing gap loitering \\\n",
- "0 {'total_distance_km': 1.553408717842079, 'aver... None None \n",
- "1 {'total_distance_km': 3.2539329459390007, 'ave... None None \n",
- "2 {'total_distance_km': 5.18218418253593, 'avera... None None \n",
- "3 {'total_distance_km': 13.20298689870354, 'aver... None None \n",
- "4 {'total_distance_km': 4.430991184550807, 'aver... None None \n",
+ "0 {'total_distance_km': 5.313381753510874, 'aver... None None \n",
+ "1 {'total_distance_km': 10.200405590755741, 'ave... None None \n",
+ "2 {'total_distance_km': 31.90361153133585, 'aver... None None \n",
+ "3 {'total_distance_km': 5.725649380735478, 'aver... None None \n",
+ "4 {'total_distance_km': 2.3609454154613645, 'ave... None None \n",
"\n",
" port_visit \n",
"0 None \n",
diff --git a/notebooks/usage-guides/4wings-api.ipynb b/notebooks/usage-guides/4wings-api.ipynb
index d825bef..b523b61 100644
--- a/notebooks/usage-guides/4wings-api.ipynb
+++ b/notebooks/usage-guides/4wings-api.ipynb
@@ -28,7 +28,7 @@
"id": "e9ca2eda-18f1-4f9c-9717-fb1a06423958"
},
"source": [
- "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access the 4Wings API, which is designed for generating reports and statistics on activities within specified regions."
+ "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access the [4Wings API](https://globalfishingwatch.org/our-apis/documentation#map-visualization-4wings-api), which is designed for generating reports and statistics on activities within specified regions."
]
},
{
@@ -36,7 +36,7 @@
"id": "3d31e934-e291-453d-aad9-6e0e61d1318e",
"metadata": {},
"source": [
- "**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."
+ "**Note:** See the [Datasets](https://globalfishingwatch.org/our-apis/documentation#api-dataset), [AIS Apparent Fishing Effort Data Caveats](https://globalfishingwatch.org/our-apis/documentation#apparent-fishing-effort), [AIS Vessel Presence Data Caveats](https://globalfishingwatch.org/our-apis/documentation#ais-vessel-presence-caveats), [SAR Vessel Detections Data Caveats](https://globalfishingwatch.org/our-apis/documentation#sar-vessel-detections-data-caveats), 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."
]
},
{
@@ -101,6 +101,14 @@
"## Usage"
]
},
+ {
+ "cell_type": "markdown",
+ "id": "fe7df9a0-cd5e-4b99-94b4-07b2ca0481f0",
+ "metadata": {},
+ "source": [
+ "Import and use `gfw-api-python-client` in your Python codes"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 2,
@@ -111,6 +119,7 @@
"outputs": [],
"source": [
"import os\n",
+ "\n",
"import gfwapiclient as gfw"
]
},
@@ -127,7 +136,7 @@
" from google.colab import userdata\n",
"\n",
" access_token = userdata.get(\"GFW_API_ACCESS_TOKEN\")\n",
- "except Exception as exc:\n",
+ "except Exception:\n",
" access_token = os.environ.get(\"GFW_API_ACCESS_TOKEN\")\n",
"\n",
"access_token = access_token or \"\""
@@ -165,7 +174,7 @@
},
{
"cell_type": "code",
- "execution_count": 5,
+ "execution_count": 38,
"id": "338223ff-9c23-47f6-bf33-2aaaefc35081",
"metadata": {},
"outputs": [],
@@ -193,7 +202,7 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": 39,
"id": "3bff3854-9b54-44c9-a7f8-3ef2bf1b7719",
"metadata": {},
"outputs": [],
@@ -203,7 +212,7 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": 40,
"id": "21e8b553-20dd-43bb-92c3-0e7f5f6f29c3",
"metadata": {},
"outputs": [],
@@ -213,7 +222,7 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": 41,
"id": "29bd8b84-1f22-4a11-9861-548237926012",
"metadata": {},
"outputs": [
@@ -223,7 +232,7 @@
"('2022-03', 'RUS', 7.109166666666667, 3, 75.8, 44.0)"
]
},
- "execution_count": 8,
+ "execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
@@ -249,7 +258,7 @@
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": 42,
"id": "a778ef19-f68d-4e0b-8b37-539db79868cb",
"metadata": {},
"outputs": [],
@@ -259,7 +268,51 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 43,
+ "id": "271d446a-702d-42bb-93a9-e576741a3fdd",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 32271 entries, 0 to 32270\n",
+ "Data columns (total 20 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 date 32271 non-null object \n",
+ " 1 detections 0 non-null object \n",
+ " 2 flag 32271 non-null object \n",
+ " 3 gear_type 0 non-null object \n",
+ " 4 hours 32271 non-null float64\n",
+ " 5 vessel_ids 32271 non-null int64 \n",
+ " 6 vessel_id 0 non-null object \n",
+ " 7 vessel_type 0 non-null object \n",
+ " 8 entry_timestamp 0 non-null object \n",
+ " 9 exit_timestamp 0 non-null object \n",
+ " 10 first_transmission_date 0 non-null object \n",
+ " 11 last_transmission_date 0 non-null object \n",
+ " 12 imo 0 non-null object \n",
+ " 13 mmsi 0 non-null object \n",
+ " 14 call_sign 0 non-null object \n",
+ " 15 dataset 0 non-null object \n",
+ " 16 report_dataset 32271 non-null object \n",
+ " 17 ship_name 0 non-null object \n",
+ " 18 lat 32271 non-null float64\n",
+ " 19 lon 32271 non-null float64\n",
+ "dtypes: float64(3), int64(1), object(16)\n",
+ "memory usage: 4.9+ MB\n"
+ ]
+ }
+ ],
+ "source": [
+ "fishing_effort_report_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
"id": "5145b645-c0fe-4780-b94f-261b534b7f04",
"metadata": {},
"outputs": [
@@ -309,12 +362,12 @@
" \n",
" \n",
" | 0 | \n",
- " 2022-03 | \n",
+ " 2022-02 | \n",
" None | \n",
" RUS | \n",
" None | \n",
- " 3.416944 | \n",
- " 2 | \n",
+ " 58.298253 | \n",
+ " 18 | \n",
" None | \n",
" None | \n",
" None | \n",
@@ -327,8 +380,8 @@
" None | \n",
" public-global-fishing-effort:v3.0 | \n",
" None | \n",
- " 75.6 | \n",
- " 50.3 | \n",
+ " 54.5 | \n",
+ " 151.4 | \n",
"
\n",
" \n",
" | 1 | \n",
@@ -336,8 +389,8 @@
" None | \n",
" RUS | \n",
" None | \n",
- " 2.144444 | \n",
- " 3 | \n",
+ " 53.717894 | \n",
+ " 9 | \n",
" None | \n",
" None | \n",
" None | \n",
@@ -350,17 +403,17 @@
" None | \n",
" public-global-fishing-effort:v3.0 | \n",
" None | \n",
- " 51.4 | \n",
- " 155.4 | \n",
+ " 70.4 | \n",
+ " 32.3 | \n",
"
\n",
" \n",
" | 2 | \n",
- " 2022-03 | \n",
+ " 2022-02 | \n",
" None | \n",
" RUS | \n",
" None | \n",
- " 5.436944 | \n",
- " 2 | \n",
+ " 1.083333 | \n",
+ " 1 | \n",
" None | \n",
" None | \n",
" None | \n",
@@ -373,8 +426,8 @@
" None | \n",
" public-global-fishing-effort:v3.0 | \n",
" None | \n",
- " 58.6 | \n",
- " 155.8 | \n",
+ " 56.2 | \n",
+ " 155.4 | \n",
"
\n",
" \n",
" | 3 | \n",
@@ -382,8 +435,8 @@
" None | \n",
" RUS | \n",
" None | \n",
- " 4.435556 | \n",
- " 1 | \n",
+ " 5.364167 | \n",
+ " 2 | \n",
" None | \n",
" None | \n",
" None | \n",
@@ -396,8 +449,8 @@
" None | \n",
" public-global-fishing-effort:v3.0 | \n",
" None | \n",
- " 45.7 | \n",
- " 149.8 | \n",
+ " 50.0 | \n",
+ " 141.8 | \n",
"
\n",
" \n",
" | 4 | \n",
@@ -405,8 +458,8 @@
" None | \n",
" RUS | \n",
" None | \n",
- " 0.362778 | \n",
- " 1 | \n",
+ " 2.393056 | \n",
+ " 2 | \n",
" None | \n",
" None | \n",
" None | \n",
@@ -419,20 +472,20 @@
" None | \n",
" public-global-fishing-effort:v3.0 | \n",
" None | \n",
- " 46.7 | \n",
- " 141.9 | \n",
+ " 56.2 | \n",
+ " 162.5 | \n",
"
\n",
" \n",
"\n",
""
],
"text/plain": [
- " date detections flag gear_type hours vessel_ids vessel_id \\\n",
- "0 2022-03 None RUS None 3.416944 2 None \n",
- "1 2022-02 None RUS None 2.144444 3 None \n",
- "2 2022-03 None RUS None 5.436944 2 None \n",
- "3 2022-01 None RUS None 4.435556 1 None \n",
- "4 2022-03 None RUS None 0.362778 1 None \n",
+ " date detections flag gear_type hours vessel_ids vessel_id \\\n",
+ "0 2022-02 None RUS None 58.298253 18 None \n",
+ "1 2022-02 None RUS None 53.717894 9 None \n",
+ "2 2022-02 None RUS None 1.083333 1 None \n",
+ "3 2022-01 None RUS None 5.364167 2 None \n",
+ "4 2022-03 None RUS None 2.393056 2 None \n",
"\n",
" vessel_type entry_timestamp exit_timestamp first_transmission_date \\\n",
"0 None None None None \n",
@@ -449,14 +502,14 @@
"4 None None None None None \n",
"\n",
" report_dataset ship_name lat lon \n",
- "0 public-global-fishing-effort:v3.0 None 75.6 50.3 \n",
- "1 public-global-fishing-effort:v3.0 None 51.4 155.4 \n",
- "2 public-global-fishing-effort:v3.0 None 58.6 155.8 \n",
- "3 public-global-fishing-effort:v3.0 None 45.7 149.8 \n",
- "4 public-global-fishing-effort:v3.0 None 46.7 141.9 "
+ "0 public-global-fishing-effort:v3.0 None 54.5 151.4 \n",
+ "1 public-global-fishing-effort:v3.0 None 70.4 32.3 \n",
+ "2 public-global-fishing-effort:v3.0 None 56.2 155.4 \n",
+ "3 public-global-fishing-effort:v3.0 None 50.0 141.8 \n",
+ "4 public-global-fishing-effort:v3.0 None 56.2 162.5 "
]
},
- "execution_count": 10,
+ "execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
@@ -491,7 +544,7 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 45,
"id": "0946a5ab-5090-4920-94dd-88c733528f5b",
"metadata": {},
"outputs": [],
@@ -519,7 +572,7 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 46,
"id": "5a5d349d-f60f-4fd3-997e-f74c82d2d4f9",
"metadata": {},
"outputs": [],
@@ -529,7 +582,7 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 47,
"id": "f4435324-5b39-40dd-897e-6a7ef7620a93",
"metadata": {},
"outputs": [],
@@ -539,7 +592,7 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 49,
"id": "b2990454-d924-4288-8e4f-90e4ab60015b",
"metadata": {},
"outputs": [
@@ -549,7 +602,7 @@
"('2022-03', 'RUS', 1.0, 1, 52.1, 153.2)"
]
},
- "execution_count": 14,
+ "execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
@@ -575,7 +628,7 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 50,
"id": "4ad188a4-fbaf-41ee-ab4b-6aeda56e0e57",
"metadata": {},
"outputs": [],
@@ -585,7 +638,51 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 51,
+ "id": "71bee1f2-2316-4908-9fdf-668854cd3c49",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 274333 entries, 0 to 274332\n",
+ "Data columns (total 20 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 date 274333 non-null object \n",
+ " 1 detections 0 non-null object \n",
+ " 2 flag 274333 non-null object \n",
+ " 3 gear_type 0 non-null object \n",
+ " 4 hours 274333 non-null float64\n",
+ " 5 vessel_ids 274333 non-null int64 \n",
+ " 6 vessel_id 0 non-null object \n",
+ " 7 vessel_type 0 non-null object \n",
+ " 8 entry_timestamp 0 non-null object \n",
+ " 9 exit_timestamp 0 non-null object \n",
+ " 10 first_transmission_date 0 non-null object \n",
+ " 11 last_transmission_date 0 non-null object \n",
+ " 12 imo 0 non-null object \n",
+ " 13 mmsi 0 non-null object \n",
+ " 14 call_sign 0 non-null object \n",
+ " 15 dataset 0 non-null object \n",
+ " 16 report_dataset 274333 non-null object \n",
+ " 17 ship_name 0 non-null object \n",
+ " 18 lat 274333 non-null float64\n",
+ " 19 lon 274333 non-null float64\n",
+ "dtypes: float64(3), int64(1), object(16)\n",
+ "memory usage: 41.9+ MB\n"
+ ]
+ }
+ ],
+ "source": [
+ "ais_presence_report_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
"id": "b8c04941-74fc-4a46-bc00-9e66afc59e10",
"metadata": {},
"outputs": [
@@ -782,7 +879,7 @@
"4 public-global-presence:v3.0 None 50.0 157.0 "
]
},
- "execution_count": 16,
+ "execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
@@ -817,7 +914,7 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 19,
"id": "45789061-c4e1-4938-b061-79122adb25da",
"metadata": {},
"outputs": [],
@@ -845,7 +942,7 @@
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 53,
"id": "c8f3894f-9d4a-4b2a-8f18-751c8155fddb",
"metadata": {},
"outputs": [],
@@ -855,7 +952,7 @@
},
{
"cell_type": "code",
- "execution_count": 19,
+ "execution_count": 54,
"id": "c138eca3-4921-4056-8b68-6d658901fd17",
"metadata": {},
"outputs": [],
@@ -865,7 +962,7 @@
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": 55,
"id": "50d60501-e2c2-4b41-a341-845440c8cc8f",
"metadata": {},
"outputs": [
@@ -875,7 +972,7 @@
"('2022-04', '', 1, 1, 46.6, 142.6)"
]
},
- "execution_count": 20,
+ "execution_count": 55,
"metadata": {},
"output_type": "execute_result"
}
@@ -901,7 +998,7 @@
},
{
"cell_type": "code",
- "execution_count": 21,
+ "execution_count": 56,
"id": "05179b03-f391-45c7-86ce-c26e3f27eef0",
"metadata": {},
"outputs": [],
@@ -911,7 +1008,51 @@
},
{
"cell_type": "code",
- "execution_count": 22,
+ "execution_count": 72,
+ "id": "e8fa4e6f-efb9-4e5a-96f9-679bbc3578f8",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 3995 entries, 0 to 3994\n",
+ "Data columns (total 20 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 date 3995 non-null object \n",
+ " 1 detections 3995 non-null int64 \n",
+ " 2 flag 3995 non-null object \n",
+ " 3 gear_type 0 non-null object \n",
+ " 4 hours 0 non-null object \n",
+ " 5 vessel_ids 3995 non-null int64 \n",
+ " 6 vessel_id 0 non-null object \n",
+ " 7 vessel_type 0 non-null object \n",
+ " 8 entry_timestamp 0 non-null object \n",
+ " 9 exit_timestamp 0 non-null object \n",
+ " 10 first_transmission_date 0 non-null object \n",
+ " 11 last_transmission_date 0 non-null object \n",
+ " 12 imo 0 non-null object \n",
+ " 13 mmsi 0 non-null object \n",
+ " 14 call_sign 0 non-null object \n",
+ " 15 dataset 0 non-null object \n",
+ " 16 report_dataset 3995 non-null object \n",
+ " 17 ship_name 0 non-null object \n",
+ " 18 lat 3995 non-null float64\n",
+ " 19 lon 3995 non-null float64\n",
+ "dtypes: float64(2), int64(2), object(16)\n",
+ "memory usage: 624.3+ KB\n"
+ ]
+ }
+ ],
+ "source": [
+ "sar_presence_report_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 58,
"id": "6b1fee79-c5ab-42f6-98fe-7c0be9312b1e",
"metadata": {},
"outputs": [
@@ -961,9 +1102,9 @@
" \n",
" \n",
" | 0 | \n",
- " 2022-01 | \n",
+ " 2022-02 | \n",
" 1 | \n",
- " | \n",
+ " LBR | \n",
" None | \n",
" None | \n",
" 1 | \n",
@@ -979,17 +1120,17 @@
" None | \n",
" public-global-sar-presence:v3.0 | \n",
" None | \n",
- " 44.6 | \n",
- " 38.0 | \n",
+ " 47.2 | \n",
+ " 153.0 | \n",
"
\n",
" \n",
" | 1 | \n",
- " 2022-03 | \n",
- " 3 | \n",
- " RUS | \n",
+ " 2022-02 | \n",
+ " 1 | \n",
+ " BHS | \n",
" None | \n",
" None | \n",
- " 3 | \n",
+ " 1 | \n",
" None | \n",
" None | \n",
" None | \n",
@@ -1002,14 +1143,14 @@
" None | \n",
" public-global-sar-presence:v3.0 | \n",
" None | \n",
- " 46.7 | \n",
- " 141.8 | \n",
+ " 44.2 | \n",
+ " 37.3 | \n",
"
\n",
" \n",
" | 2 | \n",
- " 2022-04 | \n",
+ " 2022-02 | \n",
" 1 | \n",
- " RUS | \n",
+ " | \n",
" None | \n",
" None | \n",
" 1 | \n",
@@ -1025,17 +1166,17 @@
" None | \n",
" public-global-sar-presence:v3.0 | \n",
" None | \n",
- " 46.8 | \n",
- " 141.4 | \n",
+ " 46.3 | \n",
+ " 142.4 | \n",
"
\n",
" \n",
" | 3 | \n",
- " 2022-02 | \n",
- " 2 | \n",
- " GRC | \n",
+ " 2022-04 | \n",
+ " 17 | \n",
+ " RUS | \n",
" None | \n",
" None | \n",
- " 2 | \n",
+ " 14 | \n",
" None | \n",
" None | \n",
" None | \n",
@@ -1048,14 +1189,14 @@
" None | \n",
" public-global-sar-presence:v3.0 | \n",
" None | \n",
- " 44.2 | \n",
- " 37.4 | \n",
+ " 45.5 | \n",
+ " 36.7 | \n",
"
\n",
" \n",
" | 4 | \n",
- " 2022-01 | \n",
+ " 2022-04 | \n",
" 1 | \n",
- " MLT | \n",
+ " SGP | \n",
" None | \n",
" None | \n",
" 1 | \n",
@@ -1071,8 +1212,8 @@
" None | \n",
" public-global-sar-presence:v3.0 | \n",
" None | \n",
- " 43.8 | \n",
- " 38.7 | \n",
+ " 46.3 | \n",
+ " 151.9 | \n",
"
\n",
" \n",
"\n",
@@ -1080,11 +1221,11 @@
],
"text/plain": [
" date detections flag gear_type hours vessel_ids vessel_id vessel_type \\\n",
- "0 2022-01 1 None None 1 None None \n",
- "1 2022-03 3 RUS None None 3 None None \n",
- "2 2022-04 1 RUS None None 1 None None \n",
- "3 2022-02 2 GRC None None 2 None None \n",
- "4 2022-01 1 MLT None None 1 None None \n",
+ "0 2022-02 1 LBR None None 1 None None \n",
+ "1 2022-02 1 BHS None None 1 None None \n",
+ "2 2022-02 1 None None 1 None None \n",
+ "3 2022-04 17 RUS None None 14 None None \n",
+ "4 2022-04 1 SGP None None 1 None None \n",
"\n",
" entry_timestamp exit_timestamp first_transmission_date \\\n",
"0 None None None \n",
@@ -1101,14 +1242,14 @@
"4 None None None None None \n",
"\n",
" report_dataset ship_name lat lon \n",
- "0 public-global-sar-presence:v3.0 None 44.6 38.0 \n",
- "1 public-global-sar-presence:v3.0 None 46.7 141.8 \n",
- "2 public-global-sar-presence:v3.0 None 46.8 141.4 \n",
- "3 public-global-sar-presence:v3.0 None 44.2 37.4 \n",
- "4 public-global-sar-presence:v3.0 None 43.8 38.7 "
+ "0 public-global-sar-presence:v3.0 None 47.2 153.0 \n",
+ "1 public-global-sar-presence:v3.0 None 44.2 37.3 \n",
+ "2 public-global-sar-presence:v3.0 None 46.3 142.4 \n",
+ "3 public-global-sar-presence:v3.0 None 45.5 36.7 \n",
+ "4 public-global-sar-presence:v3.0 None 46.3 151.9 "
]
},
- "execution_count": 22,
+ "execution_count": 58,
"metadata": {},
"output_type": "execute_result"
}
@@ -1145,7 +1286,7 @@
},
{
"cell_type": "code",
- "execution_count": 23,
+ "execution_count": 26,
"id": "d446f679-746a-4942-a5e0-ef1ca1324d65",
"metadata": {
"id": "d446f679-746a-4942-a5e0-ef1ca1324d65"
@@ -1156,7 +1297,11 @@
" spatial_resolution=\"LOW\",\n",
" temporal_resolution=\"MONTHLY\",\n",
" group_by=\"FLAG\",\n",
- " datasets=[\"public-global-fishing-effort:latest\"],\n",
+ " datasets=[\n",
+ " \"public-global-fishing-effort:latest\",\n",
+ " \"public-global-sar-presence:latest\",\n",
+ " \"public-global-presence:latest\",\n",
+ " ],\n",
" start_date=\"2022-01-01\",\n",
" end_date=\"2022-05-01\",\n",
" region={\n",
@@ -1178,7 +1323,7 @@
},
{
"cell_type": "code",
- "execution_count": 24,
+ "execution_count": 67,
"id": "cc7947e2-d2cb-45b1-b47b-818bf4bebc95",
"metadata": {
"id": "cc7947e2-d2cb-45b1-b47b-818bf4bebc95"
@@ -1190,7 +1335,7 @@
},
{
"cell_type": "code",
- "execution_count": 25,
+ "execution_count": 68,
"id": "198ad2ee-a199-4d9e-8e76-0deb8395461f",
"metadata": {
"id": "198ad2ee-a199-4d9e-8e76-0deb8395461f"
@@ -1202,7 +1347,7 @@
},
{
"cell_type": "code",
- "execution_count": 26,
+ "execution_count": 69,
"id": "2ba5f27b-f881-40a2-a75b-f00a139f1d34",
"metadata": {
"colab": {
@@ -1215,10 +1360,10 @@
{
"data": {
"text/plain": [
- "('2022-03', 'RUS', 7.109166666666667, 3, 75.8, 44.0)"
+ "('2022-03', 'RUS', 1.0, 1, 52.1, 153.2)"
]
},
- "execution_count": 26,
+ "execution_count": 69,
"metadata": {},
"output_type": "execute_result"
}
@@ -1246,7 +1391,7 @@
},
{
"cell_type": "code",
- "execution_count": 27,
+ "execution_count": 62,
"id": "3720799b-192f-4b77-9ca2-a3614942d2d7",
"metadata": {
"id": "3720799b-192f-4b77-9ca2-a3614942d2d7"
@@ -1258,7 +1403,51 @@
},
{
"cell_type": "code",
- "execution_count": 28,
+ "execution_count": 66,
+ "id": "7f298c61-d038-4d2e-86f2-2d5a554aa267",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 310599 entries, 0 to 310598\n",
+ "Data columns (total 20 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 date 310599 non-null object \n",
+ " 1 detections 3995 non-null float64\n",
+ " 2 flag 310599 non-null object \n",
+ " 3 gear_type 0 non-null object \n",
+ " 4 hours 306604 non-null float64\n",
+ " 5 vessel_ids 310599 non-null int64 \n",
+ " 6 vessel_id 0 non-null object \n",
+ " 7 vessel_type 0 non-null object \n",
+ " 8 entry_timestamp 0 non-null object \n",
+ " 9 exit_timestamp 0 non-null object \n",
+ " 10 first_transmission_date 0 non-null object \n",
+ " 11 last_transmission_date 0 non-null object \n",
+ " 12 imo 0 non-null object \n",
+ " 13 mmsi 0 non-null object \n",
+ " 14 call_sign 0 non-null object \n",
+ " 15 dataset 0 non-null object \n",
+ " 16 report_dataset 310599 non-null object \n",
+ " 17 ship_name 0 non-null object \n",
+ " 18 lat 310599 non-null float64\n",
+ " 19 lon 310599 non-null float64\n",
+ "dtypes: float64(4), int64(1), object(15)\n",
+ "memory usage: 47.4+ MB\n"
+ ]
+ }
+ ],
+ "source": [
+ "report_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 64,
"id": "8cce33de-675d-42c6-8eac-36974a9e7f48",
"metadata": {
"colab": {
@@ -1316,7 +1505,7 @@
" \n",
" | 0 | \n",
" 2022-03 | \n",
- " None | \n",
+ " NaN | \n",
" RUS | \n",
" None | \n",
" 3.416944 | \n",
@@ -1339,7 +1528,7 @@
"
\n",
" | 1 | \n",
" 2022-02 | \n",
- " None | \n",
+ " NaN | \n",
" RUS | \n",
" None | \n",
" 2.144444 | \n",
@@ -1362,7 +1551,7 @@
"
\n",
" | 2 | \n",
" 2022-03 | \n",
- " None | \n",
+ " NaN | \n",
" RUS | \n",
" None | \n",
" 5.436944 | \n",
@@ -1385,7 +1574,7 @@
"
\n",
" | 3 | \n",
" 2022-01 | \n",
- " None | \n",
+ " NaN | \n",
" RUS | \n",
" None | \n",
" 4.435556 | \n",
@@ -1408,7 +1597,7 @@
"
\n",
" | 4 | \n",
" 2022-03 | \n",
- " None | \n",
+ " NaN | \n",
" RUS | \n",
" None | \n",
" 0.362778 | \n",
@@ -1433,12 +1622,12 @@
""
],
"text/plain": [
- " date detections flag gear_type hours vessel_ids vessel_id \\\n",
- "0 2022-03 None RUS None 3.416944 2 None \n",
- "1 2022-02 None RUS None 2.144444 3 None \n",
- "2 2022-03 None RUS None 5.436944 2 None \n",
- "3 2022-01 None RUS None 4.435556 1 None \n",
- "4 2022-03 None RUS None 0.362778 1 None \n",
+ " date detections flag gear_type hours vessel_ids vessel_id \\\n",
+ "0 2022-03 NaN RUS None 3.416944 2 None \n",
+ "1 2022-02 NaN RUS None 2.144444 3 None \n",
+ "2 2022-03 NaN RUS None 5.436944 2 None \n",
+ "3 2022-01 NaN RUS None 4.435556 1 None \n",
+ "4 2022-03 NaN RUS None 0.362778 1 None \n",
"\n",
" vessel_type entry_timestamp exit_timestamp first_transmission_date \\\n",
"0 None None None None \n",
@@ -1462,7 +1651,7 @@
"4 public-global-fishing-effort:v3.0 None 46.7 141.9 "
]
},
- "execution_count": 28,
+ "execution_count": 64,
"metadata": {},
"output_type": "execute_result"
}
diff --git a/notebooks/usage-guides/bulk-downloads-api.ipynb b/notebooks/usage-guides/bulk-downloads-api.ipynb
new file mode 100644
index 0000000..fb7b832
--- /dev/null
+++ b/notebooks/usage-guides/bulk-downloads-api.ipynb
@@ -0,0 +1,1409 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "7f3b7119",
+ "metadata": {
+ "colab_type": "text",
+ "id": "view-in-github"
+ },
+ "source": [
+ "
"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "493f86ff-cee9-4fb0-8e5f-b3a0903df39e",
+ "metadata": {
+ "id": "493f86ff-cee9-4fb0-8e5f-b3a0903df39e"
+ },
+ "source": [
+ "# Bulk Download API"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e9ca2eda-18f1-4f9c-9717-fb1a06423958",
+ "metadata": {
+ "id": "e9ca2eda-18f1-4f9c-9717-fb1a06423958"
+ },
+ "source": [
+ "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access the [Bulk Download API](https://globalfishingwatch.org/our-apis/documentation#bulk-download-api), which is designed to support workflows that require bulk access to data, including integration with platforms and tools used by data engineers and researchers."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3d31e934-e291-453d-aad9-6e0e61d1318e",
+ "metadata": {},
+ "source": [
+ "**Note:** See the [Datasets](https://globalfishingwatch.org/our-apis/documentation#api-dataset), [Data Caveats](https://globalfishingwatch.org/our-apis/documentation#data-caveat), [SAR (Synthetic-Aperture Radar) Data Caveats](https://globalfishingwatch.org/our-apis/documentation#sar-fixed-infrastructure-data-caveats), 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."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "cb352526-90e2-45fd-8732-e34f0342f30f",
+ "metadata": {
+ "id": "cb352526-90e2-45fd-8732-e34f0342f30f"
+ },
+ "source": [
+ "## Prerequisites"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "57109889-5f3f-45b3-a594-2f82b94bcadb",
+ "metadata": {
+ "id": "57109889-5f3f-45b3-a594-2f82b94bcadb"
+ },
+ "source": [
+ "Before using the `gfw-api-python-client`, ensure it is installed (see the [Getting Started](https://globalfishingwatch.github.io/gfw-api-python-client/getting-started.html) guide) and that you have obtained an API access token from the [Global Fishing Watch API portal](https://globalfishingwatch.org/our-apis/tokens)."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3d1d4bf0-e6f7-4bda-9a79-4c6b6a42d1a1",
+ "metadata": {
+ "id": "3d1d4bf0-e6f7-4bda-9a79-4c6b6a42d1a1"
+ },
+ "source": [
+ "## Installation"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e8ed8d6d-214c-4888-bbb9-3798adabe12b",
+ "metadata": {
+ "id": "e8ed8d6d-214c-4888-bbb9-3798adabe12b"
+ },
+ "source": [
+ "The `gfw-api-python-client` can be easily installed using pip:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "d863fe42-f9f6-4a6e-b736-f0adc82581fe",
+ "metadata": {
+ "id": "d863fe42-f9f6-4a6e-b736-f0adc82581fe"
+ },
+ "outputs": [],
+ "source": [
+ "# %pip install gfw-api-python-client"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9c023a54-4d23-4cc2-bd36-659d4d78789e",
+ "metadata": {
+ "id": "9c023a54-4d23-4cc2-bd36-659d4d78789e"
+ },
+ "source": [
+ "## Usage"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fe7df9a0-cd5e-4b99-94b4-07b2ca0481f0",
+ "metadata": {},
+ "source": [
+ "Import and use `gfw-api-python-client` in your Python codes"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "2420e772-c8c6-4eec-bbab-db0708733b50",
+ "metadata": {
+ "id": "2420e772-c8c6-4eec-bbab-db0708733b50"
+ },
+ "outputs": [],
+ "source": [
+ "import time\n",
+ "import os\n",
+ "\n",
+ "import gfwapiclient as gfw"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "c1fae7c8-2806-4468-84f0-2ca90b4f5653",
+ "metadata": {
+ "id": "c1fae7c8-2806-4468-84f0-2ca90b4f5653"
+ },
+ "outputs": [],
+ "source": [
+ "try:\n",
+ " from google.colab import userdata\n",
+ "\n",
+ " access_token = userdata.get(\"GFW_API_ACCESS_TOKEN\")\n",
+ "except Exception:\n",
+ " access_token = os.environ.get(\"GFW_API_ACCESS_TOKEN\")\n",
+ "\n",
+ "access_token = access_token or \"\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "08c9daef-552d-4906-ac21-eaedcea7b102",
+ "metadata": {
+ "id": "08c9daef-552d-4906-ac21-eaedcea7b102"
+ },
+ "outputs": [],
+ "source": [
+ "gfw_client = gfw.Client(\n",
+ " access_token=access_token,\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1528b997-f892-46d3-976f-4b81794b1f3a",
+ "metadata": {},
+ "source": [
+ "## Create a Bulk Report (`create_bulk_report`)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "73b742ef-d9f5-4903-8ff9-743d7486b126",
+ "metadata": {},
+ "source": [
+ "The `create_bulk_report()` method allows you **create** a bulk report based on specified filters and spatial parameters. The `name` parameter is mandatory. Please [learn more about create a bulk report here](https://globalfishingwatch.org/our-apis/documentation#create-a-bulk-report) and [check its data caveats here](https://globalfishingwatch.org/our-apis/documentation#data-caveat) and [here](https://globalfishingwatch.org/our-apis/documentation#sar-fixed-infrastructure-data-caveats)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "a0496b62-ca37-4d36-adb8-42ab8b69690e",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "timestamp = int(time.time() * 1000)\n",
+ "dataset = \"public-fixed-infrastructure-data:latest\"\n",
+ "region_dataset = \"public-eez-areas\"\n",
+ "region_id = \"8466\" # Argentinian Exclusive Economic Zone\n",
+ "name = f\"{dataset.split(':')[0]}_{region_dataset}__{region_id}_{timestamp}\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "aebdbd17-f0da-4f76-929d-ad26a53d5e1b",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "'public-fixed-infrastructure-data_public-eez-areas__8466_1768085547174'"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "name"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "802695e0-d728-4194-967d-7a6eba3a5916",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "create_bulk_report_result = await gfw_client.bulk_downloads.create_bulk_report(\n",
+ " name=name,\n",
+ " dataset=dataset,\n",
+ " region={\n",
+ " \"dataset\": region_dataset,\n",
+ " \"id\": region_id,\n",
+ " },\n",
+ " filters=[\"label = 'oil'\", \"label_confidence = 'high'\"],\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b1bb0495-6fd0-48e3-9583-429dd8d8b778",
+ "metadata": {},
+ "source": [
+ "### Access Create a Bulk Report Result as Pydantic models"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "fb381ffe-1441-4543-866d-f47ea4675f40",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "create_bulk_report_data = create_bulk_report_result.data()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "d2dc3e1e-c332-4d91-9209-a0680a67d31c",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "('c5e32895-4374-41d2-8b2e-ac414ed6757f',\n",
+ " 'public-fixed-infrastructure-data_public-eez-areas__8466_1768085547174',\n",
+ " 'pending',\n",
+ " datetime.datetime(2026, 1, 10, 22, 52, 30, 9000, tzinfo=TzInfo(0)))"
+ ]
+ },
+ "execution_count": 9,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "(\n",
+ " create_bulk_report_data.id,\n",
+ " create_bulk_report_data.name,\n",
+ " create_bulk_report_data.status,\n",
+ " create_bulk_report_data.created_at,\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b9d29b17-db63-4b07-9736-8fab781833d6",
+ "metadata": {},
+ "source": [
+ "### Access Create a Bulk Report Result as a DataFrame"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "f68b5906-3811-47f1-ad3d-a4a3ab14b374",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "create_bulk_report_df = create_bulk_report_result.df()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "6744d8c2-a550-4635-8aed-4a58c0f2d64d",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 1 entries, 0 to 0\n",
+ "Data columns (total 12 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 id 1 non-null object \n",
+ " 1 name 1 non-null object \n",
+ " 2 file_path 1 non-null object \n",
+ " 3 format 1 non-null object \n",
+ " 4 filters 1 non-null object \n",
+ " 5 geom 1 non-null object \n",
+ " 6 status 1 non-null object \n",
+ " 7 owner_id 1 non-null int64 \n",
+ " 8 owner_type 1 non-null object \n",
+ " 9 created_at 1 non-null datetime64[ns, UTC]\n",
+ " 10 updated_at 1 non-null datetime64[ns, UTC]\n",
+ " 11 file_size 0 non-null object \n",
+ "dtypes: datetime64[ns, UTC](2), int64(1), object(9)\n",
+ "memory usage: 228.0+ bytes\n"
+ ]
+ }
+ ],
+ "source": [
+ "create_bulk_report_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "d152ac16-99f6-4675-8f6e-a7f92302e4c2",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " id | \n",
+ " name | \n",
+ " file_path | \n",
+ " format | \n",
+ " filters | \n",
+ " geom | \n",
+ " status | \n",
+ " owner_id | \n",
+ " owner_type | \n",
+ " created_at | \n",
+ " updated_at | \n",
+ " file_size | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " c5e32895-4374-41d2-8b2e-ac414ed6757f | \n",
+ " public-fixed-infrastructure-data_public-eez-ar... | \n",
+ " sar_fixed_infrastructure_202409.csv | \n",
+ " JSON | \n",
+ " [label = 'oil', label_confidence = 'high'] | \n",
+ " {'type': 'dataset', 'dataset': 'public-eez-are... | \n",
+ " pending | \n",
+ " 39 | \n",
+ " application | \n",
+ " 2026-01-10 22:52:30.009000+00:00 | \n",
+ " 2026-01-10 22:52:30.009000+00:00 | \n",
+ " None | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " id \\\n",
+ "0 c5e32895-4374-41d2-8b2e-ac414ed6757f \n",
+ "\n",
+ " name \\\n",
+ "0 public-fixed-infrastructure-data_public-eez-ar... \n",
+ "\n",
+ " file_path format \\\n",
+ "0 sar_fixed_infrastructure_202409.csv JSON \n",
+ "\n",
+ " filters \\\n",
+ "0 [label = 'oil', label_confidence = 'high'] \n",
+ "\n",
+ " geom status owner_id \\\n",
+ "0 {'type': 'dataset', 'dataset': 'public-eez-are... pending 39 \n",
+ "\n",
+ " owner_type created_at \\\n",
+ "0 application 2026-01-10 22:52:30.009000+00:00 \n",
+ "\n",
+ " updated_at file_size \n",
+ "0 2026-01-10 22:52:30.009000+00:00 None "
+ ]
+ },
+ "execution_count": 12,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "create_bulk_report_df.head()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ba3d1019-43d4-4d78-8b05-1b9a875aff73",
+ "metadata": {},
+ "source": [
+ "## Get Bulk Report by ID (`get_bulk_report_by_id`)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b577a216-dd60-420f-aeef-51243eb09a32",
+ "metadata": {},
+ "source": [
+ "The `get_bulk_report_by_id()` method allows you retrieves **metadata and status** of the previously created bulk report based on the provided bulk report ID. The `id` parameter is mandatory. Please [learn more about get bulk report by id report here](https://globalfishingwatch.org/our-apis/documentation#get-bulk-report-by-id) and [check its data caveats here](https://globalfishingwatch.org/our-apis/documentation#data-caveat) and [here](https://globalfishingwatch.org/our-apis/documentation#sar-fixed-infrastructure-data-caveats)."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "60e5e9ba-33a2-438f-8528-0366779e6e70",
+ "metadata": {},
+ "source": [
+ " **Important:** We recommend to use this method to poll the status of previously created bulk report, if it takes **several minutes or hours** to generate until it status is `done` or `failed`."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "id": "1a05b7ff-26fb-40ad-b578-74e7647eb687",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_report_result = await gfw_client.bulk_downloads.get_bulk_report_by_id(\n",
+ " id=create_bulk_report_data.id\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "da68ee08-c25d-40aa-b0a7-520e8408f529",
+ "metadata": {},
+ "source": [
+ "### Access Get Bulk Report by ID Result as Pydantic models"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "id": "2f064920-a66c-48d8-9f20-2fb36b7dc4bc",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_report_data = bulk_report_result.data()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "id": "a966e319-3214-410e-b063-e0f51f68d04c",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "('c5e32895-4374-41d2-8b2e-ac414ed6757f',\n",
+ " 'public-fixed-infrastructure-data_public-eez-areas__8466_1768085547174',\n",
+ " 'pending',\n",
+ " datetime.datetime(2026, 1, 10, 22, 52, 30, 9000, tzinfo=TzInfo(0)))"
+ ]
+ },
+ "execution_count": 15,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "(\n",
+ " create_bulk_report_data.id,\n",
+ " create_bulk_report_data.name,\n",
+ " create_bulk_report_data.status,\n",
+ " create_bulk_report_data.created_at,\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d33878dc-be26-47c1-9e28-68127c4c2869",
+ "metadata": {},
+ "source": [
+ "### Access Get Bulk Report by ID Result as a DataFrame"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "id": "7cf258fa-e0d0-45c3-9f39-06f547f61529",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_report_df = bulk_report_result.df()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "id": "57381d93-fdf1-4fd3-aec2-71bbdf877bc8",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 1 entries, 0 to 0\n",
+ "Data columns (total 12 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 id 1 non-null object \n",
+ " 1 name 1 non-null object \n",
+ " 2 file_path 1 non-null object \n",
+ " 3 format 1 non-null object \n",
+ " 4 filters 1 non-null object \n",
+ " 5 geom 1 non-null object \n",
+ " 6 status 1 non-null object \n",
+ " 7 owner_id 1 non-null int64 \n",
+ " 8 owner_type 1 non-null object \n",
+ " 9 created_at 1 non-null datetime64[ns, UTC]\n",
+ " 10 updated_at 1 non-null datetime64[ns, UTC]\n",
+ " 11 file_size 0 non-null object \n",
+ "dtypes: datetime64[ns, UTC](2), int64(1), object(9)\n",
+ "memory usage: 228.0+ bytes\n"
+ ]
+ }
+ ],
+ "source": [
+ "bulk_report_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "id": "89f76538-0bc2-4258-bb27-410cd9cc5b85",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " id | \n",
+ " name | \n",
+ " file_path | \n",
+ " format | \n",
+ " filters | \n",
+ " geom | \n",
+ " status | \n",
+ " owner_id | \n",
+ " owner_type | \n",
+ " created_at | \n",
+ " updated_at | \n",
+ " file_size | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " c5e32895-4374-41d2-8b2e-ac414ed6757f | \n",
+ " public-fixed-infrastructure-data_public-eez-ar... | \n",
+ " sar_fixed_infrastructure_202409.csv | \n",
+ " JSON | \n",
+ " [label = 'oil', label_confidence = 'high'] | \n",
+ " {'type': 'dataset', 'dataset': 'public-eez-are... | \n",
+ " pending | \n",
+ " 39 | \n",
+ " application | \n",
+ " 2026-01-10 22:52:30.009000+00:00 | \n",
+ " 2026-01-10 22:52:30.009000+00:00 | \n",
+ " None | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " id \\\n",
+ "0 c5e32895-4374-41d2-8b2e-ac414ed6757f \n",
+ "\n",
+ " name \\\n",
+ "0 public-fixed-infrastructure-data_public-eez-ar... \n",
+ "\n",
+ " file_path format \\\n",
+ "0 sar_fixed_infrastructure_202409.csv JSON \n",
+ "\n",
+ " filters \\\n",
+ "0 [label = 'oil', label_confidence = 'high'] \n",
+ "\n",
+ " geom status owner_id \\\n",
+ "0 {'type': 'dataset', 'dataset': 'public-eez-are... pending 39 \n",
+ "\n",
+ " owner_type created_at \\\n",
+ "0 application 2026-01-10 22:52:30.009000+00:00 \n",
+ "\n",
+ " updated_at file_size \n",
+ "0 2026-01-10 22:52:30.009000+00:00 None "
+ ]
+ },
+ "execution_count": 18,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "bulk_report_df.head()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c30c9de1-8fcc-45cc-91ad-339d1e1944ee",
+ "metadata": {},
+ "source": [
+ "## Get All Bulk Reports Created by User or Application (`get_all_bulk_reports`)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d5f9e8ad-f137-446b-a38f-9caa4f233925",
+ "metadata": {},
+ "source": [
+ "The `get_all_bulk_reports()` method allows you retrieves a list of **metadata and status** of the previously created bulk reports based on specified pagination, sorting, and filtering criteria. Please [learn more about get all bulk reports created by user or application here](https://globalfishingwatch.org/our-apis/documentation#get-all-bulk-reports-by-user) and [check its data caveats here](https://globalfishingwatch.org/our-apis/documentation#data-caveat) and [here](https://globalfishingwatch.org/our-apis/documentation#sar-fixed-infrastructure-data-caveats)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "id": "338223ff-9c23-47f6-bf33-2aaaefc35081",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_reports_result = await gfw_client.bulk_downloads.get_all_bulk_reports(\n",
+ " status=\"done\",\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "86738d44-fed7-4dd9-8014-d72ae3c22ae7",
+ "metadata": {},
+ "source": [
+ "### Access All Created Bulk Reports Result as Pydantic models"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "id": "3bff3854-9b54-44c9-a7f8-3ef2bf1b7719",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_reports_data = bulk_reports_result.data()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "id": "21e8b553-20dd-43bb-92c3-0e7f5f6f29c3",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_report_item = bulk_reports_data[-1]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "id": "29bd8b84-1f22-4a11-9861-548237926012",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "('0c0cada1-72dd-4fb0-bdf6-7fe8c7fdb1e3',\n",
+ " 'sar-fixed-infrastructure-data-20241207-region-1',\n",
+ " 'done',\n",
+ " datetime.datetime(2025, 12, 7, 10, 3, 12, 371000, tzinfo=TzInfo(0)))"
+ ]
+ },
+ "execution_count": 22,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "(\n",
+ " bulk_report_item.id,\n",
+ " bulk_report_item.name,\n",
+ " bulk_report_item.status,\n",
+ " bulk_report_item.created_at,\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f1294498-7b8c-4054-85b3-a24ecee90340",
+ "metadata": {},
+ "source": [
+ "### Access All Created Bulk Reports Result as a DataFrame"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "id": "a778ef19-f68d-4e0b-8b37-539db79868cb",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_reports_df = bulk_reports_result.df()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "id": "271d446a-702d-42bb-93a9-e576741a3fdd",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 7 entries, 0 to 6\n",
+ "Data columns (total 12 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 id 7 non-null object \n",
+ " 1 name 7 non-null object \n",
+ " 2 file_path 7 non-null object \n",
+ " 3 format 7 non-null object \n",
+ " 4 filters 7 non-null object \n",
+ " 5 geom 4 non-null object \n",
+ " 6 status 7 non-null object \n",
+ " 7 owner_id 7 non-null int64 \n",
+ " 8 owner_type 7 non-null object \n",
+ " 9 created_at 7 non-null datetime64[ns, UTC]\n",
+ " 10 updated_at 7 non-null datetime64[ns, UTC]\n",
+ " 11 file_size 7 non-null float64 \n",
+ "dtypes: datetime64[ns, UTC](2), float64(1), int64(1), object(8)\n",
+ "memory usage: 804.0+ bytes\n"
+ ]
+ }
+ ],
+ "source": [
+ "bulk_reports_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "id": "5145b645-c0fe-4780-b94f-261b534b7f04",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " id | \n",
+ " name | \n",
+ " file_path | \n",
+ " format | \n",
+ " filters | \n",
+ " geom | \n",
+ " status | \n",
+ " owner_id | \n",
+ " owner_type | \n",
+ " created_at | \n",
+ " updated_at | \n",
+ " file_size | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 705f2f9a-f695-43f1-a4bf-7746f3deb091 | \n",
+ " public-fixed-infrastructure-data_public-eez-ar... | \n",
+ " sar_fixed_infrastructure_202409.csv | \n",
+ " JSON | \n",
+ " [label = 'oil', label_confidence = 'high'] | \n",
+ " {'type': 'dataset', 'dataset': 'public-eez-are... | \n",
+ " done | \n",
+ " 39 | \n",
+ " application | \n",
+ " 2026-01-10 22:47:37.506000+00:00 | \n",
+ " 2026-01-10 22:47:37.506000+00:00 | \n",
+ " 22224.0 | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 89e29012-bd90-4718-a6ba-71c0e3ea6260 | \n",
+ " public-fixed-infrastructure-data_public-eez-ar... | \n",
+ " sar_fixed_infrastructure_202409.csv | \n",
+ " JSON | \n",
+ " [label = 'oil', label_confidence = 'high'] | \n",
+ " {'type': 'dataset', 'dataset': 'public-eez-are... | \n",
+ " done | \n",
+ " 39 | \n",
+ " application | \n",
+ " 2026-01-10 21:57:03.520000+00:00 | \n",
+ " 2026-01-10 21:57:03.520000+00:00 | \n",
+ " 22224.0 | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 9e8d0d20-a635-4d36-83f4-4179c3aad156 | \n",
+ " sar-fixed-infrastructure-data-20241207-all-oil... | \n",
+ " sar_fixed_infrastructure_202409.csv | \n",
+ " JSON | \n",
+ " [label = 'oil', label_confidence = 'high'] | \n",
+ " None | \n",
+ " done | \n",
+ " 39 | \n",
+ " application | \n",
+ " 2025-12-07 14:09:17.712000+00:00 | \n",
+ " 2025-12-07 14:09:17.712000+00:00 | \n",
+ " 18223879.0 | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 7a036b8f-21fc-4c53-a6cb-2d90caf1c2a5 | \n",
+ " sar-fixed-infrastructure-data-20241207-all-lab... | \n",
+ " sar_fixed_infrastructure_202409.csv | \n",
+ " JSON | \n",
+ " [label_confidence = 'high' or label_confidence... | \n",
+ " None | \n",
+ " done | \n",
+ " 39 | \n",
+ " application | \n",
+ " 2025-12-07 12:21:33.424000+00:00 | \n",
+ " 2025-12-07 12:21:33.424000+00:00 | \n",
+ " 122605450.0 | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 568d2d08-82f8-4243-a120-103c6417eef2 | \n",
+ " sar-fixed-infrastructure-data-20241207-all-1 | \n",
+ " sar_fixed_infrastructure_202409.csv | \n",
+ " JSON | \n",
+ " [label_confidence = 'high'] | \n",
+ " None | \n",
+ " done | \n",
+ " 39 | \n",
+ " application | \n",
+ " 2025-12-07 10:12:40.192000+00:00 | \n",
+ " 2025-12-07 10:12:40.192000+00:00 | \n",
+ " 117135274.0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " id \\\n",
+ "0 705f2f9a-f695-43f1-a4bf-7746f3deb091 \n",
+ "1 89e29012-bd90-4718-a6ba-71c0e3ea6260 \n",
+ "2 9e8d0d20-a635-4d36-83f4-4179c3aad156 \n",
+ "3 7a036b8f-21fc-4c53-a6cb-2d90caf1c2a5 \n",
+ "4 568d2d08-82f8-4243-a120-103c6417eef2 \n",
+ "\n",
+ " name \\\n",
+ "0 public-fixed-infrastructure-data_public-eez-ar... \n",
+ "1 public-fixed-infrastructure-data_public-eez-ar... \n",
+ "2 sar-fixed-infrastructure-data-20241207-all-oil... \n",
+ "3 sar-fixed-infrastructure-data-20241207-all-lab... \n",
+ "4 sar-fixed-infrastructure-data-20241207-all-1 \n",
+ "\n",
+ " file_path format \\\n",
+ "0 sar_fixed_infrastructure_202409.csv JSON \n",
+ "1 sar_fixed_infrastructure_202409.csv JSON \n",
+ "2 sar_fixed_infrastructure_202409.csv JSON \n",
+ "3 sar_fixed_infrastructure_202409.csv JSON \n",
+ "4 sar_fixed_infrastructure_202409.csv JSON \n",
+ "\n",
+ " filters \\\n",
+ "0 [label = 'oil', label_confidence = 'high'] \n",
+ "1 [label = 'oil', label_confidence = 'high'] \n",
+ "2 [label = 'oil', label_confidence = 'high'] \n",
+ "3 [label_confidence = 'high' or label_confidence... \n",
+ "4 [label_confidence = 'high'] \n",
+ "\n",
+ " geom status owner_id \\\n",
+ "0 {'type': 'dataset', 'dataset': 'public-eez-are... done 39 \n",
+ "1 {'type': 'dataset', 'dataset': 'public-eez-are... done 39 \n",
+ "2 None done 39 \n",
+ "3 None done 39 \n",
+ "4 None done 39 \n",
+ "\n",
+ " owner_type created_at \\\n",
+ "0 application 2026-01-10 22:47:37.506000+00:00 \n",
+ "1 application 2026-01-10 21:57:03.520000+00:00 \n",
+ "2 application 2025-12-07 14:09:17.712000+00:00 \n",
+ "3 application 2025-12-07 12:21:33.424000+00:00 \n",
+ "4 application 2025-12-07 10:12:40.192000+00:00 \n",
+ "\n",
+ " updated_at file_size \n",
+ "0 2026-01-10 22:47:37.506000+00:00 22224.0 \n",
+ "1 2026-01-10 21:57:03.520000+00:00 22224.0 \n",
+ "2 2025-12-07 14:09:17.712000+00:00 18223879.0 \n",
+ "3 2025-12-07 12:21:33.424000+00:00 122605450.0 \n",
+ "4 2025-12-07 10:12:40.192000+00:00 117135274.0 "
+ ]
+ },
+ "execution_count": 25,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "bulk_reports_df.head()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d00c4ba7-cc57-4503-8160-b42634c67777",
+ "metadata": {},
+ "source": [
+ "## Get Bulk Report File Download URL (`get_bulk_report_file_download_url`)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "65f7ae75-ae94-40d2-95b6-1b7eecc78356",
+ "metadata": {},
+ "source": [
+ "The `get_bulk_report_file_download_url()` method allows you retrieves **signed URL** that points to a **downloadable file** hosted on Global Fishing Watch's cloud infrastructure to **download file(s)** (i.e., `\"DATA\"`, `\"README\"`, or `\"GEOM\"`) of the previously created bulk report. The `id` parameter is mandatory. Please [learn more about get bulk report file download url here](https://globalfishingwatch.org/our-apis/documentation#download-bulk-report-url-file) and [check its data caveats here](https://globalfishingwatch.org/our-apis/documentation#data-caveat) and [here](https://globalfishingwatch.org/our-apis/documentation#sar-fixed-infrastructure-data-caveats)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "id": "70c51654-a7b9-46a9-991b-c9c97dcfe41e",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_report_file_download_url_result = (\n",
+ " await gfw_client.bulk_downloads.get_bulk_report_file_download_url(\n",
+ " id=bulk_reports_data[0].id, file=\"DATA\"\n",
+ " )\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "74dbe00c-7503-473a-aac7-5f99984d41dc",
+ "metadata": {},
+ "source": [
+ "### Access Get Bulk Report File Download URL Result as Pydantic models"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "id": "5330ef22-3ef7-4482-ae34-f1e9f6f48ccf",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_report_file_download_url_data = bulk_report_file_download_url_result.data()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "id": "4e3d4575-4c59-4c8e-b15e-2206bdb995ec",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "'https://storage.googleapis.com/gfw-api-bulk-pro-us-central1/705f2f9a-f695-43f1-a4bf-7746f3deb091/data.json.gz?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=api-bulk-pro%40gfw-production.iam.gserviceaccount.com%2F20260110%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20260110T225232Z&X-Goog-Expires=60&X-Goog-SignedHeaders=host&X-Goog-Signature=481a4ff7244b7286f303b37bb7941c291a26d1e3502debdb7611b8cb2d5edf37bc7aa0287b15a11c2f69f72e88791da3f76873a2fd7d08f911691c35ee8e095b825615510de8256f8cd275211997141e026837e118d86e01c026c457dc1f47d43ff2cb07131c3d21e7908c847bf1e3d87cd4773f02e8e4512a7c15e93799de186b9ea004be50cd3e53292f01e9393595a81c42cc3686f65d280f4f16076759da4722c17c2a6a698393c919cdd083402421a1bbf425b618244b3a9b30e48b770a9dc7f9eed8e63af04f8e31f0b6723fdf76fa7262ded89e7a375fbaea3b031bf29db22b1961878facd79c92d633ab6aa2309c0ce3982104d9835058ecd829bee8'"
+ ]
+ },
+ "execution_count": 28,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "bulk_report_file_download_url_data.url"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a7115103-5942-429d-a247-2947f01e139f",
+ "metadata": {},
+ "source": [
+ "### Access Get Bulk Report File Download URL Result as a DataFrame"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "id": "7750da1f-e4cd-4fcd-9fe2-472e2d4e98b9",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_report_file_download_url_df = bulk_report_file_download_url_result.df()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "id": "ac6aada1-e0a2-4a31-9421-ce88c55aebb4",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 1 entries, 0 to 0\n",
+ "Data columns (total 1 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 url 1 non-null object\n",
+ "dtypes: object(1)\n",
+ "memory usage: 140.0+ bytes\n"
+ ]
+ }
+ ],
+ "source": [
+ "bulk_report_file_download_url_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "id": "b6fe6c39-3e0a-43c2-8279-8fa1eebb18e6",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "'https://storage.googleapis.com/gfw-api-bulk-pro-us-central1/705f2f9a-f695-43f1-a4bf-7746f3deb091/data.json.gz?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=api-bulk-pro%40gfw-production.iam.gserviceaccount.com%2F20260110%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20260110T225232Z&X-Goog-Expires=60&X-Goog-SignedHeaders=host&X-Goog-Signature=481a4ff7244b7286f303b37bb7941c291a26d1e3502debdb7611b8cb2d5edf37bc7aa0287b15a11c2f69f72e88791da3f76873a2fd7d08f911691c35ee8e095b825615510de8256f8cd275211997141e026837e118d86e01c026c457dc1f47d43ff2cb07131c3d21e7908c847bf1e3d87cd4773f02e8e4512a7c15e93799de186b9ea004be50cd3e53292f01e9393595a81c42cc3686f65d280f4f16076759da4722c17c2a6a698393c919cdd083402421a1bbf425b618244b3a9b30e48b770a9dc7f9eed8e63af04f8e31f0b6723fdf76fa7262ded89e7a375fbaea3b031bf29db22b1961878facd79c92d633ab6aa2309c0ce3982104d9835058ecd829bee8'"
+ ]
+ },
+ "execution_count": 31,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "bulk_report_file_download_url_df.iloc[0][\"url\"]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "775f0875-6fef-45d7-ad1a-c589927a3f4b",
+ "metadata": {},
+ "source": [
+ "## Query Bulk Fixed Infrastructure Data Report (`query_bulk_fixed_infrastructure_data_report`)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8f321b5e-3405-46fe-a92e-4d2bb698df36",
+ "metadata": {},
+ "source": [
+ "The `query_bulk_fixed_infrastructure_data_report()` method allows you retrieves **data records** of a previously created **fixed infrastructure data** (i.e., `public-fixed-infrastructure-data:latest` dataset) bulk report data in JSON format based on specified pagination, sorting, and including criteria. The `id` parameter is mandatory. Please [learn more about query bulk fixed infrastructure data report in JSON format here](https://globalfishingwatch.org/our-apis/documentation#get-data-in-json-format) and [check its data caveats here](https://globalfishingwatch.org/our-apis/documentation#data-caveat) and [here](https://globalfishingwatch.org/our-apis/documentation#sar-fixed-infrastructure-data-caveats)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "id": "cd2f2b83-c2c6-4729-b229-1564ff9b4bbe",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_fixed_infrastructure_data_report_result = (\n",
+ " await gfw_client.bulk_downloads.query_bulk_fixed_infrastructure_data_report(\n",
+ " id=bulk_reports_data[0].id\n",
+ " )\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "79b3a72d-ec5b-4d6f-ace3-519ac1949592",
+ "metadata": {},
+ "source": [
+ "### Access Query Bulk Fixed Infrastructure Data Report Result as Pydantic models"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "id": "fc0e5713-8747-4afe-b7de-6cd5de4527af",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_fixed_infrastructure_data_report_data = (\n",
+ " bulk_fixed_infrastructure_data_report_result.data()\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "id": "d45b9472-9051-4c15-9085-a4d904baef67",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_fixed_infrastructure_data_report_item = bulk_fixed_infrastructure_data_report_data[\n",
+ " -1\n",
+ "]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "id": "032db92c-3a8d-4f73-a5cb-b567abe5de03",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "('1051638', -53.0895574340617, -67.32289149541135, 'oil', 'high')"
+ ]
+ },
+ "execution_count": 35,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "(\n",
+ " bulk_fixed_infrastructure_data_report_item.structure_id,\n",
+ " bulk_fixed_infrastructure_data_report_item.lat,\n",
+ " bulk_fixed_infrastructure_data_report_item.lon,\n",
+ " bulk_fixed_infrastructure_data_report_item.label,\n",
+ " bulk_fixed_infrastructure_data_report_item.label_confidence,\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "32b433f4-baed-4b0e-9989-9a02fbbc5fd9",
+ "metadata": {},
+ "source": [
+ "### Access Query Bulk Fixed Infrastructure Data Report Result as a DataFrame"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "id": "b38b2a5b-bfd7-4308-a8fa-1efb609d70c8",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bulk_fixed_infrastructure_data_report_result_df = (\n",
+ " bulk_fixed_infrastructure_data_report_result.df()\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "id": "a10e881e-928c-41aa-b47e-c33e9fdfb95d",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 1238 entries, 0 to 1237\n",
+ "Data columns (total 9 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 detection_id 1237 non-null object \n",
+ " 1 detection_date 1238 non-null datetime64[ns]\n",
+ " 2 structure_id 1238 non-null object \n",
+ " 3 lat 1238 non-null float64 \n",
+ " 4 lon 1238 non-null float64 \n",
+ " 5 structure_start_date 1238 non-null datetime64[ns]\n",
+ " 6 structure_end_date 7 non-null datetime64[ns]\n",
+ " 7 label 1238 non-null object \n",
+ " 8 label_confidence 1238 non-null object \n",
+ "dtypes: datetime64[ns](3), float64(2), object(4)\n",
+ "memory usage: 87.2+ KB\n"
+ ]
+ }
+ ],
+ "source": [
+ "bulk_fixed_infrastructure_data_report_result_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "id": "2c0bb2d5-c119-4a74-800b-aef1efbc5df4",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " detection_id | \n",
+ " detection_date | \n",
+ " structure_id | \n",
+ " lat | \n",
+ " lon | \n",
+ " structure_start_date | \n",
+ " structure_end_date | \n",
+ " label | \n",
+ " label_confidence | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " S1AB_AD_MEDIAN_COMP_20170902T000000_20180301T0... | \n",
+ " 2017-12-01 | \n",
+ " 313068 | \n",
+ " -52.612197 | \n",
+ " -68.449292 | \n",
+ " 2017-01-01 | \n",
+ " NaT | \n",
+ " oil | \n",
+ " high | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " S1AB_AD_MEDIAN_COMP_20231101T000000_20240501T0... | \n",
+ " 2024-02-01 | \n",
+ " 313068 | \n",
+ " -52.612197 | \n",
+ " -68.449292 | \n",
+ " 2017-01-01 | \n",
+ " NaT | \n",
+ " oil | \n",
+ " high | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " S1AB_AD_MEDIAN_COMP_20230501T000000_20231101T0... | \n",
+ " 2023-08-01 | \n",
+ " 313068 | \n",
+ " -52.612197 | \n",
+ " -68.449292 | \n",
+ " 2017-01-01 | \n",
+ " NaT | \n",
+ " oil | \n",
+ " high | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " S1AB_AD_MEDIAN_COMP_20220901T000000_20230301T0... | \n",
+ " 2022-12-01 | \n",
+ " 313068 | \n",
+ " -52.612197 | \n",
+ " -68.449292 | \n",
+ " 2017-01-01 | \n",
+ " NaT | \n",
+ " oil | \n",
+ " high | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " S1AB_AD_MEDIAN_COMP_20220701T000000_20230101T0... | \n",
+ " 2022-10-01 | \n",
+ " 313068 | \n",
+ " -52.612197 | \n",
+ " -68.449292 | \n",
+ " 2017-01-01 | \n",
+ " NaT | \n",
+ " oil | \n",
+ " high | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " detection_id detection_date \\\n",
+ "0 S1AB_AD_MEDIAN_COMP_20170902T000000_20180301T0... 2017-12-01 \n",
+ "1 S1AB_AD_MEDIAN_COMP_20231101T000000_20240501T0... 2024-02-01 \n",
+ "2 S1AB_AD_MEDIAN_COMP_20230501T000000_20231101T0... 2023-08-01 \n",
+ "3 S1AB_AD_MEDIAN_COMP_20220901T000000_20230301T0... 2022-12-01 \n",
+ "4 S1AB_AD_MEDIAN_COMP_20220701T000000_20230101T0... 2022-10-01 \n",
+ "\n",
+ " structure_id lat lon structure_start_date structure_end_date \\\n",
+ "0 313068 -52.612197 -68.449292 2017-01-01 NaT \n",
+ "1 313068 -52.612197 -68.449292 2017-01-01 NaT \n",
+ "2 313068 -52.612197 -68.449292 2017-01-01 NaT \n",
+ "3 313068 -52.612197 -68.449292 2017-01-01 NaT \n",
+ "4 313068 -52.612197 -68.449292 2017-01-01 NaT \n",
+ "\n",
+ " label label_confidence \n",
+ "0 oil high \n",
+ "1 oil high \n",
+ "2 oil high \n",
+ "3 oil high \n",
+ "4 oil high "
+ ]
+ },
+ "execution_count": 38,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "bulk_fixed_infrastructure_data_report_result_df.head()"
+ ]
+ }
+ ],
+ "metadata": {
+ "colab": {
+ "include_colab_link": true,
+ "provenance": []
+ },
+ "kernelspec": {
+ "display_name": "Python 3 (ipykernel)",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.11.14"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/notebooks/usage-guides/datasets-api.ipynb b/notebooks/usage-guides/datasets-api.ipynb
index 41f53ea..03fd43f 100644
--- a/notebooks/usage-guides/datasets-api.ipynb
+++ b/notebooks/usage-guides/datasets-api.ipynb
@@ -28,7 +28,7 @@
"id": "41006fe2-f552-4dfc-b6d0-4b6b46aadf27"
},
"source": [
- "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access various datasets available through the Global Fishing Watch API. Currently, it focuses on retrieving SAR (Synthetic Aperture Radar) fixed infrastructure data."
+ "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access various datasets available through the Global Fishing Watch [Datasets API](https://globalfishingwatch.org/our-apis/documentation#datasets-api). Currently, it focuses on retrieving SAR (Synthetic Aperture Radar) fixed infrastructure data."
]
},
{
@@ -101,6 +101,14 @@
"## Usage"
]
},
+ {
+ "cell_type": "markdown",
+ "id": "e0ca8a5b-2028-48e0-8cb4-0c3f9601dcf6",
+ "metadata": {},
+ "source": [
+ "Import and use `gfw-api-python-client` in your Python codes"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 2,
@@ -111,6 +119,7 @@
"outputs": [],
"source": [
"import os\n",
+ "\n",
"import gfwapiclient as gfw"
]
},
@@ -127,7 +136,7 @@
" from google.colab import userdata\n",
"\n",
" access_token = userdata.get(\"GFW_API_ACCESS_TOKEN\")\n",
- "except Exception as exc:\n",
+ "except Exception:\n",
" access_token = os.environ.get(\"GFW_API_ACCESS_TOKEN\")\n",
"\n",
"access_token = access_token or \"\""
@@ -234,7 +243,7 @@
{
"data": {
"text/plain": [
- "(646348, 'oil', -39.15082587013905, 177.96658840984458)"
+ "(1065796, 'oil', -71.81842050325909, -12.6523216191814)"
]
},
"execution_count": 9,
@@ -276,6 +285,37 @@
{
"cell_type": "code",
"execution_count": 11,
+ "id": "de8e24ee-4c15-4c38-846b-fce96ec7c41a",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 1156 entries, 0 to 1155\n",
+ "Data columns (total 7 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 structure_id 1156 non-null int64 \n",
+ " 1 lat 1156 non-null float64 \n",
+ " 2 lon 1156 non-null float64 \n",
+ " 3 label 1156 non-null object \n",
+ " 4 structure_start_date 1156 non-null datetime64[ns, UTC]\n",
+ " 5 structure_end_date 857 non-null datetime64[ns, UTC]\n",
+ " 6 label_confidence 1156 non-null object \n",
+ "dtypes: datetime64[ns, UTC](2), float64(2), int64(1), object(2)\n",
+ "memory usage: 63.3+ KB\n"
+ ]
+ }
+ ],
+ "source": [
+ "sar_infrastructure_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
"id": "5350bf55-3a37-4fa9-a1d9-0642e9ece7ef",
"metadata": {
"colab": {
@@ -319,52 +359,52 @@
" \n",
" \n",
" | 0 | \n",
- " 170796 | \n",
- " 1.509645 | \n",
- " -78.888106 | \n",
- " unknown | \n",
- " 2021-11-01 00:00:00+00:00 | \n",
- " 2021-12-01 00:00:00+00:00 | \n",
- " high | \n",
- "
\n",
- " \n",
- " | 1 | \n",
- " 254126 | \n",
- " 1.029763 | \n",
- " -79.745796 | \n",
+ " 128911 | \n",
+ " -14.374089 | \n",
+ " -170.707656 | \n",
" oil | \n",
" 2017-01-01 00:00:00+00:00 | \n",
" NaT | \n",
+ " low | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 901458 | \n",
+ " -17.949867 | \n",
+ " -150.537969 | \n",
+ " unknown | \n",
+ " 2020-01-01 00:00:00+00:00 | \n",
+ " 2020-01-01 00:00:00+00:00 | \n",
" high | \n",
"
\n",
" \n",
" | 2 | \n",
- " 360586 | \n",
- " 1.021449 | \n",
- " -79.733240 | \n",
- " oil | \n",
- " 2017-01-01 00:00:00+00:00 | \n",
- " NaT | \n",
+ " 1073932 | \n",
+ " -16.838022 | \n",
+ " -148.715736 | \n",
+ " unknown | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
" high | \n",
"
\n",
" \n",
" | 3 | \n",
- " 237733 | \n",
- " 1.030971 | \n",
- " -79.717878 | \n",
- " oil | \n",
- " 2017-01-01 00:00:00+00:00 | \n",
- " NaT | \n",
+ " 1073227 | \n",
+ " -16.883566 | \n",
+ " -148.518017 | \n",
+ " unknown | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
" high | \n",
"
\n",
" \n",
" | 4 | \n",
- " 450717 | \n",
- " 1.033458 | \n",
- " -79.699540 | \n",
- " oil | \n",
- " 2017-01-01 00:00:00+00:00 | \n",
- " NaT | \n",
+ " 1073521 | \n",
+ " -16.900634 | \n",
+ " -148.443097 | \n",
+ " unknown | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
" high | \n",
"
\n",
" \n",
@@ -372,22 +412,22 @@
""
],
"text/plain": [
- " structure_id lat lon label structure_start_date \\\n",
- "0 170796 1.509645 -78.888106 unknown 2021-11-01 00:00:00+00:00 \n",
- "1 254126 1.029763 -79.745796 oil 2017-01-01 00:00:00+00:00 \n",
- "2 360586 1.021449 -79.733240 oil 2017-01-01 00:00:00+00:00 \n",
- "3 237733 1.030971 -79.717878 oil 2017-01-01 00:00:00+00:00 \n",
- "4 450717 1.033458 -79.699540 oil 2017-01-01 00:00:00+00:00 \n",
+ " structure_id lat lon label structure_start_date \\\n",
+ "0 128911 -14.374089 -170.707656 oil 2017-01-01 00:00:00+00:00 \n",
+ "1 901458 -17.949867 -150.537969 unknown 2020-01-01 00:00:00+00:00 \n",
+ "2 1073932 -16.838022 -148.715736 unknown 2025-04-01 00:00:00+00:00 \n",
+ "3 1073227 -16.883566 -148.518017 unknown 2025-04-01 00:00:00+00:00 \n",
+ "4 1073521 -16.900634 -148.443097 unknown 2025-04-01 00:00:00+00:00 \n",
"\n",
" structure_end_date label_confidence \n",
- "0 2021-12-01 00:00:00+00:00 high \n",
- "1 NaT high \n",
- "2 NaT high \n",
- "3 NaT high \n",
- "4 NaT high "
+ "0 NaT low \n",
+ "1 2020-01-01 00:00:00+00:00 high \n",
+ "2 2025-04-01 00:00:00+00:00 high \n",
+ "3 2025-04-01 00:00:00+00:00 high \n",
+ "4 2025-04-01 00:00:00+00:00 high "
]
},
- "execution_count": 11,
+ "execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
@@ -408,7 +448,7 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 13,
"id": "7b12622e-db12-4adb-9721-717070e026f8",
"metadata": {
"id": "7b12622e-db12-4adb-9721-717070e026f8"
@@ -431,7 +471,7 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 14,
"id": "02c19ae9-fb43-4f95-a9c2-e0e5b97a7089",
"metadata": {
"id": "02c19ae9-fb43-4f95-a9c2-e0e5b97a7089"
@@ -445,7 +485,7 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 15,
"id": "4ca75748-9258-4352-8286-ff3f2dacf2b0",
"metadata": {
"id": "4ca75748-9258-4352-8286-ff3f2dacf2b0"
@@ -457,7 +497,7 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 16,
"id": "276c553b-df26-43cc-a1f3-6319417552e9",
"metadata": {
"id": "276c553b-df26-43cc-a1f3-6319417552e9"
@@ -469,7 +509,7 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 17,
"id": "30f82972-50dc-4c60-a901-21c2acc17255",
"metadata": {
"colab": {
@@ -482,10 +522,10 @@
{
"data": {
"text/plain": [
- "(646348, 'oil', -39.15082587013905, 177.96658840984458)"
+ "(1065796, 'oil', -71.81842050325909, -12.6523216191814)"
]
},
- "execution_count": 16,
+ "execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
@@ -511,7 +551,7 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 18,
"id": "d29b4044-5ba2-44bf-a00f-f1b01cb35ab6",
"metadata": {
"id": "d29b4044-5ba2-44bf-a00f-f1b01cb35ab6"
@@ -523,7 +563,38 @@
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 19,
+ "id": "d7b179d5-4f23-49ce-b703-94f497230057",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 1156 entries, 0 to 1155\n",
+ "Data columns (total 7 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 structure_id 1156 non-null int64 \n",
+ " 1 lat 1156 non-null float64 \n",
+ " 2 lon 1156 non-null float64 \n",
+ " 3 label 1156 non-null object \n",
+ " 4 structure_start_date 1156 non-null datetime64[ns, UTC]\n",
+ " 5 structure_end_date 857 non-null datetime64[ns, UTC]\n",
+ " 6 label_confidence 1156 non-null object \n",
+ "dtypes: datetime64[ns, UTC](2), float64(2), int64(1), object(2)\n",
+ "memory usage: 63.3+ KB\n"
+ ]
+ }
+ ],
+ "source": [
+ "sar_infrastructure_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
"id": "7ca536d1-dfa2-4ba7-b20a-72e739c66775",
"metadata": {
"colab": {
@@ -567,52 +638,52 @@
" \n",
" \n",
" | 0 | \n",
- " 170796 | \n",
- " 1.509645 | \n",
- " -78.888106 | \n",
- " unknown | \n",
- " 2021-11-01 00:00:00+00:00 | \n",
- " 2021-12-01 00:00:00+00:00 | \n",
- " high | \n",
- "
\n",
- " \n",
- " | 1 | \n",
- " 254126 | \n",
- " 1.029763 | \n",
- " -79.745796 | \n",
+ " 128911 | \n",
+ " -14.374089 | \n",
+ " -170.707656 | \n",
" oil | \n",
" 2017-01-01 00:00:00+00:00 | \n",
" NaT | \n",
+ " low | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 901458 | \n",
+ " -17.949867 | \n",
+ " -150.537969 | \n",
+ " unknown | \n",
+ " 2020-01-01 00:00:00+00:00 | \n",
+ " 2020-01-01 00:00:00+00:00 | \n",
" high | \n",
"
\n",
" \n",
" | 2 | \n",
- " 360586 | \n",
- " 1.021449 | \n",
- " -79.733240 | \n",
- " oil | \n",
- " 2017-01-01 00:00:00+00:00 | \n",
- " NaT | \n",
+ " 1073932 | \n",
+ " -16.838022 | \n",
+ " -148.715736 | \n",
+ " unknown | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
" high | \n",
"
\n",
" \n",
" | 3 | \n",
- " 237733 | \n",
- " 1.030971 | \n",
- " -79.717878 | \n",
- " oil | \n",
- " 2017-01-01 00:00:00+00:00 | \n",
- " NaT | \n",
+ " 1073227 | \n",
+ " -16.883566 | \n",
+ " -148.518017 | \n",
+ " unknown | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
" high | \n",
"
\n",
" \n",
" | 4 | \n",
- " 450717 | \n",
- " 1.033458 | \n",
- " -79.699540 | \n",
- " oil | \n",
- " 2017-01-01 00:00:00+00:00 | \n",
- " NaT | \n",
+ " 1073521 | \n",
+ " -16.900634 | \n",
+ " -148.443097 | \n",
+ " unknown | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
+ " 2025-04-01 00:00:00+00:00 | \n",
" high | \n",
"
\n",
" \n",
@@ -620,22 +691,22 @@
""
],
"text/plain": [
- " structure_id lat lon label structure_start_date \\\n",
- "0 170796 1.509645 -78.888106 unknown 2021-11-01 00:00:00+00:00 \n",
- "1 254126 1.029763 -79.745796 oil 2017-01-01 00:00:00+00:00 \n",
- "2 360586 1.021449 -79.733240 oil 2017-01-01 00:00:00+00:00 \n",
- "3 237733 1.030971 -79.717878 oil 2017-01-01 00:00:00+00:00 \n",
- "4 450717 1.033458 -79.699540 oil 2017-01-01 00:00:00+00:00 \n",
+ " structure_id lat lon label structure_start_date \\\n",
+ "0 128911 -14.374089 -170.707656 oil 2017-01-01 00:00:00+00:00 \n",
+ "1 901458 -17.949867 -150.537969 unknown 2020-01-01 00:00:00+00:00 \n",
+ "2 1073932 -16.838022 -148.715736 unknown 2025-04-01 00:00:00+00:00 \n",
+ "3 1073227 -16.883566 -148.518017 unknown 2025-04-01 00:00:00+00:00 \n",
+ "4 1073521 -16.900634 -148.443097 unknown 2025-04-01 00:00:00+00:00 \n",
"\n",
" structure_end_date label_confidence \n",
- "0 2021-12-01 00:00:00+00:00 high \n",
- "1 NaT high \n",
- "2 NaT high \n",
- "3 NaT high \n",
- "4 NaT high "
+ "0 NaT low \n",
+ "1 2020-01-01 00:00:00+00:00 high \n",
+ "2 2025-04-01 00:00:00+00:00 high \n",
+ "3 2025-04-01 00:00:00+00:00 high \n",
+ "4 2025-04-01 00:00:00+00:00 high "
]
},
- "execution_count": 18,
+ "execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
diff --git a/notebooks/usage-guides/events-api.ipynb b/notebooks/usage-guides/events-api.ipynb
index 0893d10..bed1978 100644
--- a/notebooks/usage-guides/events-api.ipynb
+++ b/notebooks/usage-guides/events-api.ipynb
@@ -28,7 +28,7 @@
"id": "e9ca2eda-18f1-4f9c-9717-fb1a06423958"
},
"source": [
- "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access information about various activities of a vessel, including fishing activity, encounters, port visits, loitering, and gaps in AIS reporting."
+ "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access information about various activities of a vessel, including fishing activity, encounters, port visits, loitering, and gaps in AIS reporting through the Global Fishing Watch [Events API](https://globalfishingwatch.org/our-apis/documentation#events-api)."
]
},
{
@@ -101,6 +101,14 @@
"## Usage"
]
},
+ {
+ "cell_type": "markdown",
+ "id": "6d37044e-0797-4e84-991a-c13ab9997f59",
+ "metadata": {},
+ "source": [
+ "Import and use `gfw-api-python-client` in your Python codes"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 2,
@@ -111,6 +119,7 @@
"outputs": [],
"source": [
"import os\n",
+ "\n",
"import gfwapiclient as gfw"
]
},
@@ -127,7 +136,7 @@
" from google.colab import userdata\n",
"\n",
" access_token = userdata.get(\"GFW_API_ACCESS_TOKEN\")\n",
- "except Exception as exc:\n",
+ "except Exception:\n",
" access_token = os.environ.get(\"GFW_API_ACCESS_TOKEN\")\n",
"\n",
"access_token = access_token or \"\""
@@ -266,6 +275,44 @@
{
"cell_type": "code",
"execution_count": 10,
+ "id": "dafd51a8-8370-471e-9a2b-f523351a5b46",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 5 entries, 0 to 4\n",
+ "Data columns (total 14 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 start 5 non-null datetime64[ns, UTC]\n",
+ " 1 end 5 non-null datetime64[ns, UTC]\n",
+ " 2 id 5 non-null object \n",
+ " 3 type 5 non-null object \n",
+ " 4 position 5 non-null object \n",
+ " 5 regions 5 non-null object \n",
+ " 6 bounding_box 5 non-null object \n",
+ " 7 distances 5 non-null object \n",
+ " 8 vessel 5 non-null object \n",
+ " 9 encounter 0 non-null object \n",
+ " 10 fishing 5 non-null object \n",
+ " 11 gap 0 non-null object \n",
+ " 12 loitering 0 non-null object \n",
+ " 13 port_visit 0 non-null object \n",
+ "dtypes: datetime64[ns, UTC](2), object(12)\n",
+ "memory usage: 692.0+ bytes\n"
+ ]
+ }
+ ],
+ "source": [
+ "events_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
"id": "33328ed3-e2c0-456c-89d2-e13df6cb6911",
"metadata": {
"colab": {
@@ -326,7 +373,7 @@
" {'start_distance_from_shore_km': 2.0, 'end_dis... | \n",
" {'id': '9e01144bf-f383-e634-3178-ca7e34477f34'... | \n",
" None | \n",
- " {'total_distance_km': 3.4650098660546638, 'ave... | \n",
+ " {'total_distance_km': 3.4650098660546633, 'ave... | \n",
" None | \n",
" None | \n",
" None | \n",
@@ -389,12 +436,12 @@
" bbbf5d0cfa9639e5eac0130fc2b742e9 | \n",
" fishing | \n",
" {'lat': 14.9647, 'lon': -17.6039} | \n",
- " {'mpa': [], 'eez': ['8371'], 'rfmo': ['IWC', '... | \n",
+ " {'mpa': [], 'eez': ['8371'], 'rfmo': ['ACAP', ... | \n",
" [-17.480231666700007, 14.8685916667, -17.67519... | \n",
" {'start_distance_from_shore_km': 11.0, 'end_di... | \n",
" {'id': '7374d1988-87f8-6037-66b4-59854a026efb'... | \n",
" None | \n",
- " {'total_distance_km': 93.25349267584731, 'aver... | \n",
+ " {'total_distance_km': 93.2534926758473, 'avera... | \n",
" None | \n",
" None | \n",
" None | \n",
@@ -430,7 +477,7 @@
"1 {'mpa': ['555651502'], 'eez': ['8371'], 'rfmo'... \n",
"2 {'mpa': ['555705172'], 'eez': ['8371'], 'rfmo'... \n",
"3 {'mpa': [], 'eez': ['8371'], 'rfmo': ['SRFC', ... \n",
- "4 {'mpa': [], 'eez': ['8371'], 'rfmo': ['IWC', '... \n",
+ "4 {'mpa': [], 'eez': ['8371'], 'rfmo': ['ACAP', ... \n",
"\n",
" bounding_box \\\n",
"0 [-17.4119, 14.686378333333334, -17.41116833333... \n",
@@ -454,11 +501,11 @@
"4 {'id': '7374d1988-87f8-6037-66b4-59854a026efb'... None \n",
"\n",
" fishing gap loitering \\\n",
- "0 {'total_distance_km': 3.4650098660546638, 'ave... None None \n",
+ "0 {'total_distance_km': 3.4650098660546633, 'ave... None None \n",
"1 {'total_distance_km': 294.3073276985627, 'aver... None None \n",
"2 {'total_distance_km': 130.6216027333083, 'aver... None None \n",
"3 {'total_distance_km': 111.11378725724042, 'ave... None None \n",
- "4 {'total_distance_km': 93.25349267584731, 'aver... None None \n",
+ "4 {'total_distance_km': 93.2534926758473, 'avera... None None \n",
"\n",
" port_visit \n",
"0 None \n",
@@ -468,7 +515,7 @@
"4 None "
]
},
- "execution_count": 10,
+ "execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
@@ -489,7 +536,7 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 12,
"id": "7153066a-abe9-4b1a-9751-378f5486ed61",
"metadata": {
"id": "7153066a-abe9-4b1a-9751-378f5486ed61"
@@ -514,7 +561,7 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 13,
"id": "07f3cec3-752b-494e-be95-f96ff7cda93a",
"metadata": {
"id": "07f3cec3-752b-494e-be95-f96ff7cda93a"
@@ -526,7 +573,7 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 14,
"id": "1598ba96-1e0e-40ce-ade8-c2ccd721cad7",
"metadata": {
"colab": {
@@ -544,7 +591,7 @@
" '8c7304226-6c71-edbe-0b63-c246734b3c01')"
]
},
- "execution_count": 13,
+ "execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
@@ -565,7 +612,7 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 15,
"id": "5924b8c6-da8e-42a9-94ee-9b67ebdb1e7e",
"metadata": {
"id": "5924b8c6-da8e-42a9-94ee-9b67ebdb1e7e"
@@ -577,7 +624,45 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 16,
+ "id": "1754d20c-5a9c-42f1-8e02-d10fe24a43c3",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 1 entries, 0 to 0\n",
+ "Data columns (total 14 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 start 1 non-null datetime64[ns, UTC]\n",
+ " 1 end 1 non-null datetime64[ns, UTC]\n",
+ " 2 id 1 non-null object \n",
+ " 3 type 1 non-null object \n",
+ " 4 position 1 non-null object \n",
+ " 5 regions 1 non-null object \n",
+ " 6 bounding_box 1 non-null object \n",
+ " 7 distances 1 non-null object \n",
+ " 8 vessel 1 non-null object \n",
+ " 9 encounter 0 non-null object \n",
+ " 10 fishing 0 non-null object \n",
+ " 11 gap 0 non-null object \n",
+ " 12 loitering 0 non-null object \n",
+ " 13 port_visit 1 non-null object \n",
+ "dtypes: datetime64[ns, UTC](2), object(12)\n",
+ "memory usage: 244.0+ bytes\n"
+ ]
+ }
+ ],
+ "source": [
+ "event_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
"id": "9e6befd3-f970-4a05-b2d0-63ddd4adcfe0",
"metadata": {
"colab": {
@@ -633,7 +718,7 @@
" c2f0967e061f99a01793edac065de003 | \n",
" port_visit | \n",
" {'lat': 20.7288, 'lon': -17.0148} | \n",
- " {'mpa': [], 'eez': ['8369'], 'rfmo': ['ICCAT',... | \n",
+ " {'mpa': [], 'eez': ['8369'], 'rfmo': ['NAMMCO'... | \n",
" [-17.014774393446658, 20.72879719687954, -17.0... | \n",
" {'start_distance_from_shore_km': 7.0, 'end_dis... | \n",
" {'id': '8c7304226-6c71-edbe-0b63-c246734b3c01'... | \n",
@@ -658,7 +743,7 @@
"0 {'lat': 20.7288, 'lon': -17.0148} \n",
"\n",
" regions \\\n",
- "0 {'mpa': [], 'eez': ['8369'], 'rfmo': ['ICCAT',... \n",
+ "0 {'mpa': [], 'eez': ['8369'], 'rfmo': ['NAMMCO'... \n",
"\n",
" bounding_box \\\n",
"0 [-17.014774393446658, 20.72879719687954, -17.0... \n",
@@ -673,7 +758,7 @@
"0 None {'visit_id': '38affb3e7bdc67e9c0c2e7e8f3b08da2... "
]
},
- "execution_count": 15,
+ "execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
@@ -694,7 +779,7 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 18,
"id": "aacbe1ad-9806-4f83-8d4c-e37d318e1a08",
"metadata": {
"id": "aacbe1ad-9806-4f83-8d4c-e37d318e1a08"
@@ -725,7 +810,7 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 19,
"id": "20bbb945-6c45-4ae9-98c6-029a833f0aeb",
"metadata": {
"id": "20bbb945-6c45-4ae9-98c6-029a833f0aeb"
@@ -737,7 +822,7 @@
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 20,
"id": "24742d8a-d55f-4f1d-8d97-556fb2ec6572",
"metadata": {
"colab": {
@@ -750,10 +835,10 @@
{
"data": {
"text/plain": [
- "(24750, 1, 197)"
+ "(24770, 1, 196)"
]
},
- "execution_count": 18,
+ "execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
@@ -774,7 +859,7 @@
},
{
"cell_type": "code",
- "execution_count": 19,
+ "execution_count": 21,
"id": "bcdf7d04-695c-4bd6-8cbe-6e522339ad58",
"metadata": {
"id": "bcdf7d04-695c-4bd6-8cbe-6e522339ad58"
@@ -786,7 +871,36 @@
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": 22,
+ "id": "d97c2f90-6414-44f4-b82c-9a92731a18db",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 1 entries, 0 to 0\n",
+ "Data columns (total 5 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 num_events 1 non-null int64 \n",
+ " 1 num_flags 1 non-null int64 \n",
+ " 2 num_vessels 1 non-null int64 \n",
+ " 3 flags 1 non-null object\n",
+ " 4 timeseries 1 non-null object\n",
+ "dtypes: int64(3), object(2)\n",
+ "memory usage: 172.0+ bytes\n"
+ ]
+ }
+ ],
+ "source": [
+ "event_stat_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
"id": "0496f743-190f-497c-9433-a4981446c786",
"metadata": {
"colab": {
@@ -828,9 +942,9 @@
" \n",
" \n",
" | 0 | \n",
- " 24750 | \n",
+ " 24770 | \n",
" 1 | \n",
- " 197 | \n",
+ " 196 | \n",
" [RUS] | \n",
" [{'date': 2018-01-01 00:00:00+00:00, 'value': ... | \n",
"
\n",
@@ -840,13 +954,13 @@
],
"text/plain": [
" num_events num_flags num_vessels flags \\\n",
- "0 24750 1 197 [RUS] \n",
+ "0 24770 1 196 [RUS] \n",
"\n",
" timeseries \n",
"0 [{'date': 2018-01-01 00:00:00+00:00, 'value': ... "
]
},
- "execution_count": 20,
+ "execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
diff --git a/notebooks/usage-guides/insights-api.ipynb b/notebooks/usage-guides/insights-api.ipynb
index 790a793..5b7c2ad 100644
--- a/notebooks/usage-guides/insights-api.ipynb
+++ b/notebooks/usage-guides/insights-api.ipynb
@@ -28,7 +28,7 @@
"id": "e9ca2eda-18f1-4f9c-9717-fb1a06423958"
},
"source": [
- "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access aggregated insights about vessel activities."
+ "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access aggregated insights about vessel activities through the Global Fishing Watch [Insights API](https://globalfishingwatch.org/our-apis/documentation#insights-api)."
]
},
{
@@ -101,6 +101,14 @@
"## Usage"
]
},
+ {
+ "cell_type": "markdown",
+ "id": "6fa3c864-ab80-4dd9-844f-68f167aaeaf2",
+ "metadata": {},
+ "source": [
+ "Import and use `gfw-api-python-client` in your Python codes"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 2,
@@ -111,6 +119,7 @@
"outputs": [],
"source": [
"import os\n",
+ "\n",
"import gfwapiclient as gfw"
]
},
@@ -127,7 +136,7 @@
" from google.colab import userdata\n",
"\n",
" access_token = userdata.get(\"GFW_API_ACCESS_TOKEN\")\n",
- "except Exception as exc:\n",
+ "except Exception:\n",
" access_token = os.environ.get(\"GFW_API_ACCESS_TOKEN\")\n",
"\n",
"access_token = access_token or \"\""
@@ -265,6 +274,36 @@
{
"cell_type": "code",
"execution_count": 9,
+ "id": "df544af4-bcbf-424a-921b-a8d9b815ea6e",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 1 entries, 0 to 0\n",
+ "Data columns (total 6 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 period 1 non-null object\n",
+ " 1 vessel_ids_without_identity 0 non-null object\n",
+ " 2 gap 0 non-null object\n",
+ " 3 coverage 0 non-null object\n",
+ " 4 apparent_fishing 1 non-null object\n",
+ " 5 vessel_identity 0 non-null object\n",
+ "dtypes: object(6)\n",
+ "memory usage: 180.0+ bytes\n"
+ ]
+ }
+ ],
+ "source": [
+ "insights_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
"id": "5dce404d-4318-44da-8811-c4bbc5fefb77",
"metadata": {
"colab": {
@@ -329,7 +368,7 @@
"0 {'datasets': ['public-global-fishing-events:v3... None "
]
},
- "execution_count": 9,
+ "execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
diff --git a/notebooks/usage-guides/references-data-api.ipynb b/notebooks/usage-guides/references-data-api.ipynb
index 49fa4c2..1f2d52c 100644
--- a/notebooks/usage-guides/references-data-api.ipynb
+++ b/notebooks/usage-guides/references-data-api.ipynb
@@ -28,7 +28,7 @@
"id": "5d8e4401-2090-47a0-b3e1-be4d3ba5cc00"
},
"source": [
- "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access reference data, specifically geographic regions."
+ "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access reference data, specifically geographic regions through the Global Fishing Watch [Reference Data API](https://globalfishingwatch.org/our-apis/documentation#regions)."
]
},
{
@@ -101,6 +101,14 @@
"## Usage"
]
},
+ {
+ "cell_type": "markdown",
+ "id": "b201b300-884d-4ef7-895e-45c025a12962",
+ "metadata": {},
+ "source": [
+ "Import and use `gfw-api-python-client` in your Python codes"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 2,
@@ -111,6 +119,7 @@
"outputs": [],
"source": [
"import os\n",
+ "\n",
"import gfwapiclient as gfw"
]
},
@@ -127,7 +136,7 @@
" from google.colab import userdata\n",
"\n",
" access_token = userdata.get(\"GFW_API_ACCESS_TOKEN\")\n",
- "except Exception as exc:\n",
+ "except Exception:\n",
" access_token = os.environ.get(\"GFW_API_ACCESS_TOKEN\")\n",
"\n",
"access_token = access_token or \"\""
@@ -255,6 +264,38 @@
{
"cell_type": "code",
"execution_count": 10,
+ "id": "547bf861-ab6f-4362-99c5-ee70041fb6e0",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 285 entries, 0 to 284\n",
+ "Data columns (total 8 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 id 285 non-null int64 \n",
+ " 1 label 285 non-null object\n",
+ " 2 iso3 234 non-null object\n",
+ " 3 dataset 285 non-null object\n",
+ " 4 isoSov1 285 non-null object\n",
+ " 5 isoSov2 56 non-null object\n",
+ " 6 isoSov3 6 non-null object\n",
+ " 7 territory1 285 non-null object\n",
+ "dtypes: int64(1), object(7)\n",
+ "memory usage: 17.9+ KB\n"
+ ]
+ }
+ ],
+ "source": [
+ "eez_regions_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
"id": "3d2963b3-6ea1-489c-abdb-aad327ed4875",
"metadata": {
"colab": {
@@ -297,21 +338,21 @@
" 0 | \n",
" 8491 | \n",
" Jordanian Exclusive Economic Zone | \n",
- " None | \n",
+ " JOR | \n",
" public-eez-areas | \n",
" \n",
" \n",
" | 1 | \n",
" 8467 | \n",
" Uruguayan Exclusive Economic Zone | \n",
- " None | \n",
+ " URY | \n",
" public-eez-areas | \n",
"
\n",
" \n",
" | 2 | \n",
" 5683 | \n",
" Latvian Exclusive Economic Zone | \n",
- " None | \n",
+ " LVA | \n",
" public-eez-areas | \n",
"
\n",
" \n",
@@ -325,7 +366,7 @@
" | 4 | \n",
" 8327 | \n",
" South Korean Exclusive Economic Zone | \n",
- " None | \n",
+ " KOR | \n",
" public-eez-areas | \n",
"
\n",
" \n",
@@ -334,11 +375,11 @@
],
"text/plain": [
" id label iso3 \\\n",
- "0 8491 Jordanian Exclusive Economic Zone None \n",
- "1 8467 Uruguayan Exclusive Economic Zone None \n",
- "2 5683 Latvian Exclusive Economic Zone None \n",
+ "0 8491 Jordanian Exclusive Economic Zone JOR \n",
+ "1 8467 Uruguayan Exclusive Economic Zone URY \n",
+ "2 5683 Latvian Exclusive Economic Zone LVA \n",
"3 48950 Overlapping claim Kuril Islands: Japan / Russia None \n",
- "4 8327 South Korean Exclusive Economic Zone None \n",
+ "4 8327 South Korean Exclusive Economic Zone KOR \n",
"\n",
" dataset \n",
"0 public-eez-areas \n",
@@ -348,7 +389,7 @@
"4 public-eez-areas "
]
},
- "execution_count": 10,
+ "execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
@@ -369,7 +410,7 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 12,
"id": "71915ac9-7cb4-4a11-aee6-0df2ee6f9cd5",
"metadata": {
"id": "71915ac9-7cb4-4a11-aee6-0df2ee6f9cd5"
@@ -391,7 +432,7 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 13,
"id": "eee11224-fde4-4273-bfa7-da0b2c4bb9a2",
"metadata": {
"id": "eee11224-fde4-4273-bfa7-da0b2c4bb9a2"
@@ -403,7 +444,7 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 14,
"id": "845f42d9-1abe-404c-ae2c-8fc07579a612",
"metadata": {
"id": "845f42d9-1abe-404c-ae2c-8fc07579a612"
@@ -415,7 +456,7 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 15,
"id": "c8254eff-97da-4b10-b48d-bb8eea5845d8",
"metadata": {
"colab": {
@@ -428,10 +469,10 @@
{
"data": {
"text/plain": [
- "('555790807', 'public-mpa-all')"
+ "('555799979', 'public-mpa-all')"
]
},
- "execution_count": 14,
+ "execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
@@ -452,7 +493,7 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 16,
"id": "cb8f7439-5cf8-4ab9-88e1-2a84795adbb2",
"metadata": {
"id": "cb8f7439-5cf8-4ab9-88e1-2a84795adbb2"
@@ -464,7 +505,35 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 17,
+ "id": "0e111e02-aed8-49fc-bbf4-5fd293bf58d1",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 16591 entries, 0 to 16590\n",
+ "Data columns (total 4 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 id 16591 non-null object\n",
+ " 1 label 16591 non-null object\n",
+ " 2 name 0 non-null object\n",
+ " 3 dataset 16591 non-null object\n",
+ "dtypes: object(4)\n",
+ "memory usage: 518.6+ KB\n"
+ ]
+ }
+ ],
+ "source": [
+ "mpa_regions_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
"id": "0dc3268f-e099-4fe2-821b-f17d579f9d68",
"metadata": {
"colab": {
@@ -506,7 +575,7 @@
" \n",
" | 0 | \n",
" 1 | \n",
- " Diamond Reef and Salt Fish Tail Reef - Marine ... | \n",
+ " Diamond Reef - Marine Reserve | \n",
" None | \n",
" public-mpa-all | \n",
"
\n",
@@ -544,14 +613,14 @@
],
"text/plain": [
" id label name dataset\n",
- "0 1 Diamond Reef and Salt Fish Tail Reef - Marine ... None public-mpa-all\n",
+ "0 1 Diamond Reef - Marine Reserve None public-mpa-all\n",
"1 2 Palaster Reef - Marine Reserve None public-mpa-all\n",
"2 27 Folkstone - Marine Reserve None public-mpa-all\n",
"3 46 Reserva Biológica Atol Das Rocas - Reserva Bio... None public-mpa-all\n",
"4 57 Parque Nacional Do Cabo Orange - Parque None public-mpa-all"
]
},
- "execution_count": 16,
+ "execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
@@ -572,7 +641,7 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 19,
"id": "ac6c6784-e839-44ed-8b47-50c9d7f0a68a",
"metadata": {
"id": "ac6c6784-e839-44ed-8b47-50c9d7f0a68a"
@@ -594,7 +663,7 @@
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 20,
"id": "377f6c90-275f-4dbb-81d2-d1dd43e65fdd",
"metadata": {
"id": "377f6c90-275f-4dbb-81d2-d1dd43e65fdd"
@@ -606,7 +675,7 @@
},
{
"cell_type": "code",
- "execution_count": 19,
+ "execution_count": 21,
"id": "69605d0f-c97f-4e49-a4f5-d55121e9533a",
"metadata": {
"id": "69605d0f-c97f-4e49-a4f5-d55121e9533a"
@@ -618,7 +687,7 @@
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": 22,
"id": "281fe6ca-f993-4158-a225-930173c52550",
"metadata": {
"colab": {
@@ -634,7 +703,7 @@
"('BOBP-IGO', 'public-rfmo')"
]
},
- "execution_count": 20,
+ "execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
@@ -655,7 +724,7 @@
},
{
"cell_type": "code",
- "execution_count": 21,
+ "execution_count": 23,
"id": "cf0c95fd-911d-4c0a-a663-5430a9c3d073",
"metadata": {
"id": "cf0c95fd-911d-4c0a-a663-5430a9c3d073"
@@ -667,7 +736,36 @@
},
{
"cell_type": "code",
- "execution_count": 22,
+ "execution_count": 24,
+ "id": "abcf14cc-8ddb-4b01-8a58-72885e55d435",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 42 entries, 0 to 41\n",
+ "Data columns (total 5 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 id 42 non-null object\n",
+ " 1 label 42 non-null object\n",
+ " 2 rfb 0 non-null object\n",
+ " 3 dataset 42 non-null object\n",
+ " 4 ID 42 non-null object\n",
+ "dtypes: object(5)\n",
+ "memory usage: 1.8+ KB\n"
+ ]
+ }
+ ],
+ "source": [
+ "rfmo_regions_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
"id": "59d334e4-6b8a-469c-b401-72613b42bd68",
"metadata": {
"colab": {
@@ -760,7 +858,7 @@
"4 IPHC IPHC None public-rfmo IPHC"
]
},
- "execution_count": 22,
+ "execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
diff --git a/notebooks/usage-guides/vessels-api.ipynb b/notebooks/usage-guides/vessels-api.ipynb
index 6915924..1f6bcc7 100644
--- a/notebooks/usage-guides/vessels-api.ipynb
+++ b/notebooks/usage-guides/vessels-api.ipynb
@@ -28,7 +28,7 @@
"id": "e9ca2eda-18f1-4f9c-9717-fb1a06423958"
},
"source": [
- "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access information about vessels."
+ "This guide provides detailed instructions on how to use the [gfw-api-python-client](https://github.com/GlobalFishingWatch/gfw-api-python-client) to access information about vessels through the Global Fishing Watch [Vessels API](https://globalfishingwatch.org/our-apis/documentation#vessels-api)."
]
},
{
@@ -101,6 +101,14 @@
"## Usage"
]
},
+ {
+ "cell_type": "markdown",
+ "id": "903a49ab-d6c0-4a4c-adf5-11d084edeaf1",
+ "metadata": {},
+ "source": [
+ "Import and use `gfw-api-python-client` in your Python codes"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 2,
@@ -111,6 +119,7 @@
"outputs": [],
"source": [
"import os\n",
+ "\n",
"import gfwapiclient as gfw"
]
},
@@ -127,7 +136,7 @@
" from google.colab import userdata\n",
"\n",
" access_token = userdata.get(\"GFW_API_ACCESS_TOKEN\")\n",
- "except Exception as exc:\n",
+ "except Exception:\n",
" access_token = os.environ.get(\"GFW_API_ACCESS_TOKEN\")\n",
"\n",
"access_token = access_token or \"\""
@@ -168,7 +177,6 @@
"source": [
"vessel_search_result = await gfw_client.vessels.search_vessels(\n",
" where=\"ssvid='775998121' AND shipname='DON TITO'\",\n",
- " datasets=[\"public-global-vessel-identity:latest\"],\n",
" includes=[\"MATCH_CRITERIA\", \"OWNERSHIP\"],\n",
")"
]
@@ -259,6 +267,38 @@
{
"cell_type": "code",
"execution_count": 10,
+ "id": "e7641cd3-b14d-4f6d-8702-26be4400f2e7",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 2 entries, 0 to 1\n",
+ "Data columns (total 8 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 dataset 2 non-null object\n",
+ " 1 registry_info_total_records 2 non-null int64 \n",
+ " 2 registry_info 2 non-null object\n",
+ " 3 registry_owners 2 non-null object\n",
+ " 4 registry_public_authorizations 0 non-null object\n",
+ " 5 combined_sources_info 2 non-null object\n",
+ " 6 self_reported_info 2 non-null object\n",
+ " 7 matchCriteria 2 non-null object\n",
+ "dtypes: int64(1), object(7)\n",
+ "memory usage: 260.0+ bytes\n"
+ ]
+ }
+ ],
+ "source": [
+ "vessel_search_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
"id": "9f7237f0-1de2-4a21-834b-b692cf4452b5",
"metadata": {
"colab": {
@@ -349,7 +389,7 @@
"1 [{'reference': 'c54923e64-46f3-9338-9dcb-ff097... "
]
},
- "execution_count": 10,
+ "execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
@@ -370,7 +410,7 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 12,
"id": "03dbbff9-1768-4e0a-bcea-130ed46f96a0",
"metadata": {
"id": "03dbbff9-1768-4e0a-bcea-130ed46f96a0"
@@ -383,7 +423,6 @@
" \"6583c51e3-3626-5638-866a-f47c3bc7ef7c\",\n",
" \"71e7da672-2451-17da-b239-857831602eca\",\n",
" ],\n",
- " datasets=[\"public-global-vessel-identity:latest\"],\n",
")"
]
},
@@ -399,7 +438,7 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 13,
"id": "a549433e-53ac-4b7c-969a-d6f20af18668",
"metadata": {
"id": "a549433e-53ac-4b7c-969a-d6f20af18668"
@@ -411,7 +450,7 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 14,
"id": "3778b513-3cfe-49b5-9107-731d2f10d82e",
"metadata": {
"id": "3778b513-3cfe-49b5-9107-731d2f10d82e"
@@ -423,7 +462,7 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 15,
"id": "8c107871-c3eb-4544-bb6c-87188fa68675",
"metadata": {
"colab": {
@@ -436,10 +475,10 @@
{
"data": {
"text/plain": [
- "('public-global-vessel-identity:v3.0', '55889aefb-bef9-224c-d2db-58ecd01e1d7c')"
+ "('public-global-vessel-identity:v3.0', 'aca119c29-95dd-f5c4-2057-ee45268dcd6f')"
]
},
- "execution_count": 14,
+ "execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
@@ -460,7 +499,7 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 16,
"id": "d792efd2-c741-41e1-91df-f3822cd7ce46",
"metadata": {
"id": "d792efd2-c741-41e1-91df-f3822cd7ce46"
@@ -472,7 +511,38 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 17,
+ "id": "608434ad-151f-4fec-b62b-0c1800427362",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "RangeIndex: 3 entries, 0 to 2\n",
+ "Data columns (total 7 columns):\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 dataset 3 non-null object\n",
+ " 1 registry_info_total_records 3 non-null int64 \n",
+ " 2 registry_info 3 non-null object\n",
+ " 3 registry_owners 3 non-null object\n",
+ " 4 registry_public_authorizations 3 non-null object\n",
+ " 5 combined_sources_info 3 non-null object\n",
+ " 6 self_reported_info 3 non-null object\n",
+ "dtypes: int64(1), object(6)\n",
+ "memory usage: 300.0+ bytes\n"
+ ]
+ }
+ ],
+ "source": [
+ "vessels_df.info()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
"id": "3da7dec8-4f2b-4db9-aed0-38163d591af0",
"metadata": {
"colab": {
@@ -521,22 +591,12 @@
" [{'id': 'a8d00ce54b37add7f85a35fcce8e7a1b', 's... | \n",
" [{'name': 'COLINER', 'flag': 'RUS', 'ssvid': '... | \n",
" [{'date_from': 2023-01-01 00:00:00+00:00, 'dat... | \n",
- " [{'vessel_id': '3c81a942b-bf0a-f476-ea72-75c02... | \n",
+ " [{'vessel_id': 'da1cd7e1b-b8d0-539c-6581-2b3df... | \n",
" [{'id': 'da1cd7e1b-b8d0-539c-6581-2b3df8d0a6af... | \n",
"
\n",
" \n",
" | 1 | \n",
" public-global-vessel-identity:v3.0 | \n",
- " 2 | \n",
- " [{'id': 'b82d02e5c2c11e5fe5367c91194fc3ba', 's... | \n",
- " [{'name': 'DONGWON INDUSTRIES', 'flag': 'KOR, ... | \n",
- " [{'date_from': 2015-10-08 00:00:00+00:00, 'dat... | \n",
- " [{'vessel_id': 'aca119c29-95dd-f5c4-2057-ee452... | \n",
- " [{'id': '6583c51e3-3626-5638-866a-f47c3bc7ef7c... | \n",
- "
\n",
- " \n",
- " | 2 | \n",
- " public-global-vessel-identity:v3.0 | \n",
" 1 | \n",
" [{'id': '685862e0626f6234c844919bc738a83a', 's... | \n",
" [{'name': 'TRANS PACIFIC JOURNEY FISHING', 'fl... | \n",
@@ -544,6 +604,16 @@
" [{'vessel_id': '55889aefb-bef9-224c-d2db-58ecd... | \n",
" [{'id': '71e7da672-2451-17da-b239-857831602eca... | \n",
"
\n",
+ " \n",
+ " | 2 | \n",
+ " public-global-vessel-identity:v3.0 | \n",
+ " 2 | \n",
+ " [{'id': 'b82d02e5c2c11e5fe5367c91194fc3ba', 's... | \n",
+ " [{'name': 'DONGWON INDUSTRIES', 'flag': 'KOR, ... | \n",
+ " [{'date_from': 2015-10-08 00:00:00+00:00, 'dat... | \n",
+ " [{'vessel_id': 'aca119c29-95dd-f5c4-2057-ee452... | \n",
+ " [{'id': '6583c51e3-3626-5638-866a-f47c3bc7ef7c... | \n",
+ "
\n",
"
\n",
"\n",
""
@@ -551,36 +621,36 @@
"text/plain": [
" dataset registry_info_total_records \\\n",
"0 public-global-vessel-identity:v3.0 5 \n",
- "1 public-global-vessel-identity:v3.0 2 \n",
- "2 public-global-vessel-identity:v3.0 1 \n",
+ "1 public-global-vessel-identity:v3.0 1 \n",
+ "2 public-global-vessel-identity:v3.0 2 \n",
"\n",
" registry_info \\\n",
"0 [{'id': 'a8d00ce54b37add7f85a35fcce8e7a1b', 's... \n",
- "1 [{'id': 'b82d02e5c2c11e5fe5367c91194fc3ba', 's... \n",
- "2 [{'id': '685862e0626f6234c844919bc738a83a', 's... \n",
+ "1 [{'id': '685862e0626f6234c844919bc738a83a', 's... \n",
+ "2 [{'id': 'b82d02e5c2c11e5fe5367c91194fc3ba', 's... \n",
"\n",
" registry_owners \\\n",
"0 [{'name': 'COLINER', 'flag': 'RUS', 'ssvid': '... \n",
- "1 [{'name': 'DONGWON INDUSTRIES', 'flag': 'KOR, ... \n",
- "2 [{'name': 'TRANS PACIFIC JOURNEY FISHING', 'fl... \n",
+ "1 [{'name': 'TRANS PACIFIC JOURNEY FISHING', 'fl... \n",
+ "2 [{'name': 'DONGWON INDUSTRIES', 'flag': 'KOR, ... \n",
"\n",
" registry_public_authorizations \\\n",
"0 [{'date_from': 2023-01-01 00:00:00+00:00, 'dat... \n",
- "1 [{'date_from': 2015-10-08 00:00:00+00:00, 'dat... \n",
- "2 [{'date_from': 2012-01-01 00:00:00+00:00, 'dat... \n",
+ "1 [{'date_from': 2012-01-01 00:00:00+00:00, 'dat... \n",
+ "2 [{'date_from': 2015-10-08 00:00:00+00:00, 'dat... \n",
"\n",
" combined_sources_info \\\n",
- "0 [{'vessel_id': '3c81a942b-bf0a-f476-ea72-75c02... \n",
- "1 [{'vessel_id': 'aca119c29-95dd-f5c4-2057-ee452... \n",
- "2 [{'vessel_id': '55889aefb-bef9-224c-d2db-58ecd... \n",
+ "0 [{'vessel_id': 'da1cd7e1b-b8d0-539c-6581-2b3df... \n",
+ "1 [{'vessel_id': '55889aefb-bef9-224c-d2db-58ecd... \n",
+ "2 [{'vessel_id': 'aca119c29-95dd-f5c4-2057-ee452... \n",
"\n",
" self_reported_info \n",
"0 [{'id': 'da1cd7e1b-b8d0-539c-6581-2b3df8d0a6af... \n",
- "1 [{'id': '6583c51e3-3626-5638-866a-f47c3bc7ef7c... \n",
- "2 [{'id': '71e7da672-2451-17da-b239-857831602eca... "
+ "1 [{'id': '71e7da672-2451-17da-b239-857831602eca... \n",
+ "2 [{'id': '6583c51e3-3626-5638-866a-f47c3bc7ef7c... "
]
},
- "execution_count": 16,
+ "execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
@@ -601,7 +671,7 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 19,
"id": "5b12f20c-9c0e-40f6-ac13-31ad7e0144ab",
"metadata": {
"id": "5b12f20c-9c0e-40f6-ac13-31ad7e0144ab"
@@ -610,7 +680,6 @@
"source": [
"vessel_result = await gfw_client.vessels.get_vessel_by_id(\n",
" id=\"c54923e64-46f3-9338-9dcb-ff09724077a3\",\n",
- " dataset=\"public-global-vessel-identity:latest\",\n",
")"
]
},
@@ -626,7 +695,7 @@
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 20,
"id": "ba62e001-a8e9-4dac-9674-461f9cff191f",
"metadata": {
"id": "ba62e001-a8e9-4dac-9674-461f9cff191f"
@@ -638,7 +707,7 @@
},
{
"cell_type": "code",
- "execution_count": 19,
+ "execution_count": 21,
"id": "4bf8c038-2aab-49d9-acfc-86949d265dfb",
"metadata": {
"colab": {
@@ -654,7 +723,7 @@
"('public-global-vessel-identity:v3.0', 'c54923e64-46f3-9338-9dcb-ff09724077a3')"
]
},
- "execution_count": 19,
+ "execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
@@ -675,7 +744,7 @@
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": 22,
"id": "6f146ff6-f669-466a-b3fc-810a30f14a4d",
"metadata": {
"id": "6f146ff6-f669-466a-b3fc-810a30f14a4d"
@@ -687,7 +756,38 @@
},
{
"cell_type": "code",
- "execution_count": 21,
+ "execution_count": 23,
+ "id": "591d90b1-58ca-4da6-8455-c506953824bf",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "