Fetch a CVM open-data table for a regulatory-event dataset
Source:R/api-event-fetch.R
event_fetch.RdSingle entry point for retrieving any table from any CVM
event-class dataset covered by the package. Covers sanctioning
proceedings (atividade-sancionadora) and declaratory acts
issued by the CVM directors (atos-declaratorios).
Usage
event_fetch(
dataset,
table,
event = NULL,
date_range = NULL,
source = NULL,
on_error = "abort",
validate = "strict",
...
)Arguments
- dataset
Short dataset id (e.g.
"sancionadora","atos-declaratorios").- table
Snake-case table name within the dataset.
- event
Optional character vector of event identifiers (
nr_processofor sanctioning proceedings,nr_atofor declaratory acts).NULL(default) returns every event in the date range. Singular naming follows tidyverse conventions; the argument still accepts vectors of any length.- date_range
Optional
Datevector of length 2 specifying the event date window:c(from, to).NULL(default) returns every event ever published. Vectors of length other than 2 abort withcvmdata_error_input.- source
One of
"mirror"(parquet via DuckDB) or"cvm"(CVM Open Data Portal).NULL(default) resolves to the active backend viacvm_source_get().- on_error
One of
"abort"(default),"warn"or"silent". Controls behaviour on HTTP failures, analogously toissuer_fetch().- validate
One of
"strict"(default),"warn"or"skip". Controls schema validation strictness at parse time.- ...
Reserved for forward compatibility. Currently no extra arguments are accepted; passing any aborts with
cvmdata_error_input.
Value
A tibble of class cvm_tbl carrying the five provenance
attributes source, fetched_at, dataset, table and
package_version.
Details
Column names, categorical values and free-text fields are preserved in Portuguese exactly as published by CVM (snake_case minúsculo).
In v0.1.0.9000 the function is exported as a skeleton documenting
the planned contract; calling it aborts with
cvmdata_error_input_group pointing to ROADMAP.md. Full
implementation arrives in v0.8.
See also
Other fetchers:
agent_fetch(),
fund_fetch(),
issuer_fetch(),
offering_fetch()