Export Raw API-Ready Trip Data
export_api_raw.RdDownloads preprocessed WF and WCS survey data, transforms both into the canonical API schema, merges them, and uploads a single parquet file to cloud storage. This is the raw/preprocessed stage of the two-stage API export pipeline.
Usage
export_api_raw(log_threshold = logger::DEBUG)Arguments
- log_threshold
Logging level (default
logger::DEBUG).
Details
Output Schema:
survey_id: Kobo asset ID identifying the source survey formtrip_id: Unique identifier (TRIP_<submission_id>format)landing_date: Date of landinggaul_1_code,gaul_1_name: GAUL level 1 regiongaul_2_code,gaul_2_name: GAUL level 2 districtn_fishers: Total fishers (men + women + children)trip_duration_hrs: Trip duration in hoursgear: Standardised gear typevessel_type: Standardised vessel typecatch_habitat: Habitat where catch occurredcatch_outcome: Outcome of catchn_catch: Number of catch itemscatch_taxon: Species alpha-3 codescientific_name: Scientific namelength_cm: Length in cm (NA for WCS surveys)catch_kg: Catch weight in kgcatch_price: Individual-level price (NA — not resolved at this stage)tot_catch_kg: Total catch weight per triptot_catch_price: Total catch price per trip
Cloud Storage Location:
conf$api$trips$raw$cloud_path /
{file_prefix}__{timestamp}_{git_sha}__.parquet
See also
export_api_validated()for the validated-data counterpartpreprocess_wf_surveys()andpreprocess_wcs_surveys()for upstream steps