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.
Details
The function performs the following steps:
Authenticates with Pelagic Data Systems API
Retrieves boat data with device and vessel characteristics
Cleans and standardizes the data format
Maps customer names to standardized country names, and each country to its timezone
Retrieves country IDs from Airtable Countries table
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.
device_timezone comes from the country, not from the timezone PDS holds
for each tracker: PDS has reset trackers in the field to
America/Los_Angeles, a value the Airtable field does not accept.
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)
} # }
