Skip to contents

Retrieves boat/device data from Pelagic Data Systems API, processes and cleans the data, maps country information from Airtable, and syncs the results back to Airtable. This function handles the complete workflow for maintaining up-to-date device information.

Usage

ingest_pelagic_boats(conf = NULL)

Arguments

conf

List. Configuration parameters (defaults to read_config()). Must contain pds (username, password, customer_id) and airtable (token, frame base_id) configuration.

Value

List containing the authentication response and sync results.

Details

The function performs the following steps: 1. Authenticates with Pelagic Data Systems API 2. Retrieves boat data with device and vessel characteristics 3. Cleans and standardizes the data format 4. Maps customer names to standardized country names 5. Retrieves country IDs from Airtable Countries table 6. Syncs the processed data to the pds_devices Airtable table

Country mapping includes: Egypt, Timor-Leste, Mozambique, Zanzibar, Kenya, Malaysia, Malawi, Tanzania, Bangladesh, and India.

Examples

if (FALSE) { # \dontrun{
# Using default configuration
result <- ingest_pelagic_boats()

# Using custom configuration
custom_config <- read_config("custom_conf.yml")
result <- ingest_pelagic_boats(custom_config)
} # }