Skip to contents

This function handles the automated ingestion of fisheries asset metadata from Airtable. It performs the following operations:

  1. Retrieves metadata for taxa, gear types, vessel types, landing sites, and survey forms

  2. Removes duplicate records from each asset type

  3. Packages all assets into a versioned RDS file

  4. Uploads the processed file to configured cloud storage

Usage

ingest_assets(log_threshold = logger::DEBUG, package = "coasts")

Arguments

log_threshold

The logging threshold to use. Default is logger::DEBUG. See logger::log_levels for available options.

The function retrieves the following asset types from Airtable:

  • Taxa: Species information including scientific names, alpha3 codes, and English names

  • Gear: Fishing gear types with standardized names

  • Gear groups and vessel groups: Each standardized gear's FAO ISSCFG main group (fao_category) and each boat type's vessel_group, used by the FAO ARTFISH raising in generate_fleet_analysis()

  • Frame units: The census by district, boat type and main gear, either left empty where a country does not count it, read by the FAO ARTFISH raising and export_frame_data()

  • Vessels: Vessel types with standardized classifications

  • Landing Sites: Site information with codes and names

  • Forms: Survey form metadata with form IDs and names

All assets are deduplicated and stored together in a single RDS file with a versioned filename (includes timestamp and git SHA), and uploaded to the shared coasts bucket — the one every reader of the snapshot resolves.

The snapshot is cross-country: 1,609 taxa rows, 96 gears, 49 vessels and 736 landing sites across four countries as of 2026-08-13. taxa, gear and vessels therefore carry country, so a downstream package can select its own rows without inferring them from form ids. Alpha-3 codes are not sufficient on their own: every one of Timor-Leste's 56 codes is also used by Kenya, Mozambique or Zanzibar, two of them against a different scientific_name.

package

Name of the package whose inst/conf.yml to read. Defaults to "coasts". Pass your own package name when calling from a downstream package with a compatible configuration.

Value

None (invisible). The function performs its operations for side effects:

  • Creates a local RDS file containing a list of all asset data frames

  • Uploads file to configured cloud storage

  • Generates logs of the process

See also

Examples

if (FALSE) { # \dontrun{
# Ingest all fisheries assets from Airtable
ingest_assets()
} # }