Skip to contents

Fetcher

One function retrieves any CVM open-data table covered by the package; cvm_versions() returns every known version of a filing.

cvm_fetch()
Fetch a CVM open-data table
cvm_versions()
Every known version of a filing

Cache

Inspect and manage the on-disk cache of downloaded artifacts. The TTL window for HTTP revalidation is configurable via the cvmdata.cache_ttl_seconds option (default 30 days).

cvm_cache_path()
Path to the cvmdata cache directory
cvm_cache_set_path()
Set the cvmdata cache directory
cvm_cache_info()
Inventory of files in the cvmdata cache
cvm_cache_clear()
Clear cached files

Source backend

Configure which backend cvm_fetch() queries (direct CVM portal or the parquet mirror published in GitHub Releases) and, for the mirror, which dated snapshot it reads.

cvm_source_get()
Get the active cvmdata source backend
cvm_source_set()
Set the active cvmdata source backend
cvm_release_get()
Get the mirror snapshot the package reads
cvm_release_set()
Pin the mirror to a dated snapshot

Discovery

Browse the CKAN groups, datasets, tables, dictionaries and code lists carried by the package. cvm_groups() is the entry point that lists every group covered by the project roadmap (only companhias is functionally implemented in v0.1.0.9000); the remaining functions accept an optional group argument that disambiguates when a dataset slug occurs in more than one group.

cvm_groups()
List the CVM CKAN groups
cvm_datasets()
List datasets covered by the package
cvm_tables()
List the tables published in a dataset
cvm_dictionary()
Look up the CVM-published dictionary for a table
cvm_arguments()
Which arguments of cvm_fetch() a table takes
cvm_codelist()
Look up the codelist for a categorical column
cvm_dataset_years()
Range of years available for a yearly-partitioned dataset

Utilities

Find a CNPJ by company name, CNPJ formatting helpers and the provenance-carrying tibble.

cnpj_lookup()
Look up a company's CNPJ by name
cnpj_clean()
Strip punctuation from a CNPJ vector
cnpj_format()
Format a CNPJ vector with the canonical punctuation
cvm_tbl
Provenance-carrying tibbles