Skip to contents

url_or_id may be a direct download URL (as it appears in resource$url) or a CKAN resource id, in which case the URL is resolved via morie_ingest_ckan_resource_show.

Usage

morie_ingest_ckan_read_resource(
  portal,
  url_or_id,
  as_format = NULL,
  api_key = NULL,
  user_agent = .MORIE_CKAN_DEFAULT_UA,
  timeout = .MORIE_CKAN_DEFAULT_TIMEOUT
)

Arguments

portal

Base URL of the CKAN portal (only used when url_or_id is a bare resource id).

url_or_id

A direct URL or a CKAN resource id.

as_format

Optional format override ("csv", "tsv", "xlsx", "json", "parquet").

api_key

Optional CKAN API key.

user_agent

User-Agent header sent with the request.

timeout

HTTP timeout in seconds.

Value

A base R data.frame.

Details

Format detection: if as_format is given it wins. Otherwise the extension is sniffed off the URL; unknown extensions fall back to CSV (matching the Python helper).

Excel / JSON / Parquet readers require optional dependencies (readxl / jsonlite / arrow) and error with an install hint if missing.