Single entry point for retrieving any table from any CVM issuer-class dataset covered by the package. Selects the right URL, downloads (or serves from cache), parses, applies schema-declared transformations, and returns a tibble carrying provenance attributes.
Usage
issuer_fetch(
dataset,
table,
issuer = NULL,
year = NULL,
source = NULL,
report_type = NULL,
on_error = "abort",
validate = "strict",
...
)Arguments
- dataset
Short dataset id (e.g.
"cad","dfp").- table
Snake-case table name (e.g.
"companhias","bpa"). For datasets with conceptually paired tables (individual / consolidated),tableis the concept name andreport_typeselects the variant.- issuer
Optional character vector identifying issuers to include. Accepts CNPJ (with or without punctuation), CD_CVM (with or without zero-padding), a B3 trading ticker (e.g.
"PETR4","BBDC11"), or free-text matched againstdenom_cia. Detection is automatic per element; a ticker is resolved to its issuer CNPJ viafca/valor_mobiliario.NULL(default) returns every issuer. Singular naming follows tidyverse conventions; the argument still accepts vectors of any length. When the target table does not carry acd_cvmcolumn (e.g.composicao_capital,parecer), CD_CVM tokens are resolved to CNPJ via the dataset'ssubmissaotable for the same year — the user-facing interface is identical regardless of which table holds CD_CVM natively.- year
Integer vector of years to fetch.
NULL(default) fetches the latest available year. Ignored for datasets withtemporal_partitioning: none(e.g. CAD). Singular naming follows tidyverse conventions; the argument still accepts vectors of any length.- source
One of
"mirror"(parquet via DuckDB) or"cvm"(CVM Open Data Portal).NULL(default) resolves to the active backend viacvm_source_get()—"mirror"from v0.1.0 onward unless the user has flipped it viacvm_source_set("cvm").- report_type
One of
"ind","con", orNULL. Required for tables that publish individual and consolidated variants (bpa,bpp,dre,dra,dfc_md,dfc_mi,dmpl,dva). Must beNULLfor tables without that distinction (composicao_capital,submissao,parecer,companhias).- on_error
One of
"abort"(default),"warn"or"silent". Controls behaviour on HTTP failures for batches of yearly tables (year = c(...)with more than one element). With"warn", the failed years are skipped and acvmdata_warn_partial_failurewarning lists them; with"silent", the failed years are skipped silently; with"abort", the first failure aborts the call. Total batch failure (every year fails) always aborts regardless of the setting — there is no partial result to return. Parse/validation failures are governed byvalidate, noton_error. Single-year calls, non-yearly tables, and the implicit fallback whenyear = NULLalways abort on HTTP failure.- 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).
See also
Other fetchers:
agent_fetch(),
event_fetch(),
fund_fetch(),
offering_fetch()