Trending

World technology news

→
Archive photograph of the Central Bank of Brazil headquarters in Brasília.
CRANIn-depth report

R API client rbcb 0.2.0 preserves period ends in Brazilian central bank data

The R client splits long daily requests into ten-year windows and returns a previously discarded period end for some financial series.

·CRAN
Reading progress0%

Release record

The rbcb client for the Central Bank of Brazil’s open data services appeared on CRAN on November 29 at 13:20:02 UTC. The independent comparison with 0.1.14 records changes in currency helpers, dataset code, and exported names. The release notes describe several effects for a data pipeline. Some interest-rate series now preserve their period end in a separate column. Other fixes affect the retrieval of daily series and the date format sent to a currency endpoint. This release concerns the R client used to retrieve the data.

Two dates define a period

An observation can represent a period with both a start and an end. Two periods can even share a start. The release notes cite TR 226 and TBF 253 as examples. `rbcb_get` and the tabular `get_series` outputs now keep the `enddate` field. Formats organized around a single time index, including `xts` and `ts`, can reject periods with duplicate starts. An import pipeline that still uses the start date as its entire key can lose the distinction during storage.

Fetching daily series in windows

The provider continues to limit long daily queries. The client retrieves data in ten-year windows and combines their results. The notes also say that daily data can again be fetched without supplying a start date. A pipeline comparison should verify the first and last observations and the dates around each boundary. An HTTP success alone cannot show that a seam was joined correctly. An expected break in a series, such as absent weekend observations, should remain distinct from a missing response window.

PTAX dates and SGS metadata

The PTAX currency endpoint and the statistics service’s metadata page have different roles. `olinda_get_currency` now sends dates in the order expected by PTAX. `sgs()` defaults to skipping metadata, and `get_series(as = "ts")` infers frequency from the dates. This addresses a reported failure when the informational page returned an error. A pipeline that relies on metadata can test that dependency independently. A comparison with the raw series should still cover code, units, and dates.

A focused migration check

Keep two small comparison fixtures. One can contain a week of exchange-rate observations with known dates. The other can contain two interest-rate periods that share a start and have different ends. Compare the raw table before computing conversions or summaries. The second fixture should retain two distinct period ends. This establishes how the client handles the cases described in the release. Availability of the underlying service and later revisions to the data remain separate questions.

Keys for monthly reporting

Keep the series identifier, period start, and period end in the raw table. Derive a monthly label when preparing the chart. For a fixture with two periods sharing one start, the raw stage should have two rows and a filter for one period should preserve the intended row.

Archive photo · Banco Central do Brasil / Wikimedia Commons ↗ · CC BY 2.0

Sources and verification
Be the first reader ✎ Write a comment

Reader discussion

Discussion prompt

Which bottleneck would you expect as this solution scales?

No comments yet. Be the first to contribute.

Write a comment

Comments are real visitor contributions. Repeated, link-heavy or abusive submissions may be limited.