bbk

R client for central bank APIs

https://github.com/m-muecke/bbk

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.0%) to scientific vocabulary

Keywords

api bank-of-england bundesbank central-bank deutsche-bundesbank ecb european-central-bank r r-package smdx swiss-national-bank
Last synced: 10 months ago · JSON representation

Repository

R client for central bank APIs

Basic Info
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • Open Issues: 3
  • Releases: 7
Topics
api bank-of-england bundesbank central-bank deutsche-bundesbank ecb european-central-bank r r-package smdx swiss-national-bank
Created over 2 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r}
#| include: false
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
options(str = strOptions(strict.width = "cut"))
```

# bbk


[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/m-muecke/bbk/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/m-muecke/bbk/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/bbk)](https://CRAN.R-project.org/package=bbk)
[![R-universe version](https://m-muecke.r-universe.dev/bbk/badges/version)](https://m-muecke.r-universe.dev/bbk)


bbk is minimal R client for the following APIs:

- [Banco de España (BdE)](https://www.bde.es/webbe/en/estadisticas/recursos/api-estadisticas-bde.html)
- [Bank of England (BoE)](https://www.bankofengland.co.uk/boeapps/database)
- [Banque de France (BdF)](https://webstat.banque-france.fr/en/pages/guide-migration-api/)
- [Deutsche Bundesbank (BBk)](https://www.bundesbank.de/en/statistics/time-series-databases/help-for-sdmx-web-service)
- [European Central Bank (ECB)](https://data.ecb.europa.eu/help/api/overview)
- [Swiss National Bank (SNB)](https://data.snb.ch/en)
- [Österreichische Nationalbank (OeNB)](https://www.oenb.at/en/Statistics/User-Defined-Tables/webservice.html)

> In the future, it may be extended to other central banks and financial institutions.
> Feel free to open an issue if you have a specific request.

## Installation

You can install the released version of bbk from [CRAN](https://CRAN.R-project.org) with:

```{r}
#| eval: false
install.packages("bbk")
```

And the development version from [GitHub](https://github.com/) with:

```{r}
#| eval: false
# install.packages("pak")
pak::pak("m-muecke/bbk")
```

## Usage

bbk functions are prefixed according to the central bank they access (`bbk_`, `ecb_`, `snb_`,
`boe_`, `bde_`, `bdf_`, `onb_`) and follow the naming conventions of their respective APIs.

The typical workflow involves:

1. Finding the time series identifier on the relevant central bank's website
2. Using the appropriate bbk function to retrieve the data

```{r}
#| label: demo
#| message: false
library(bbk)

# Deutsche Bundesbank - fetch 10 year daily yield curve
yield_curve <- bbk_data(
  flow = "BBSIS",
  key = "D.I.ZAR.ZI.EUR.S1311.B.A604.R10XX.R.A.A._Z._Z.A",
  start_period = "2020-01-01"
)
```

```{r}
#| label: plotting
#| message: false
#| echo: false
#| dpi: 300
library(ggplot2)

ggplot(yield_curve, aes(x = date, y = value)) +
  geom_line() +
  theme_minimal() +
  theme(
    plot.title = element_text(face = "bold"),
    panel.grid.major.y = element_line(color = "black", linewidth = 0.2),
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank(),
    axis.text = element_text(color = "black"),
    axis.title = element_blank()
  ) +
  scale_y_continuous(labels = scales::label_percent(scale = 1L)) +
  labs(title = "Daily Yields of 10-Year Federal Securities")
```

## Related work

* [SNBdata](https://github.com/enricoschumann/SNBdata): R package for downloading data from the Swiss National Bank (SNB).
* [bundesbank](https://github.com/enricoschumann/bundesbank): R scripts for downloading time-series data from the Bundesbank.
* [ecb](https://github.com/expersso/ecb): R interface to the European Central Bank's Statistical Data Warehouse (SDW) API.
* [oenb](https://github.com/franzmohr/oenb): R package for accessing the OeNB's API.
* [pdfetch](https://github.com/abielr/pdfetch): R package for downloading economic and financial time series from public sources.
* [readsdmx](https://github.com/mdequeljoe/readsdmx): R package for reading SDMX data and metadata.
* [rsdmx](https://github.com/eblondel/rsdmx): R package for reading SDMX data and metadata.
* [tidyBdE](https://github.com/rOpenSpain/tidyBdE): R package for accessing the Banco de España's API.

Owner

  • Name: Maximilian Mücke
  • Login: m-muecke
  • Kind: user
  • Location: Munich, Germany

GitHub Events

Total
  • Create event: 18
  • Release event: 2
  • Issues event: 21
  • Delete event: 14
  • Issue comment event: 2
  • Push event: 192
  • Pull request event: 33
Last Year
  • Create event: 18
  • Release event: 2
  • Issues event: 21
  • Delete event: 14
  • Issue comment event: 2
  • Push event: 192
  • Pull request event: 33

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 32
  • Total pull requests: 21
  • Average time to close issues: 25 days
  • Average time to close pull requests: about 12 hours
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.06
  • Average comments per pull request: 0.0
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 21
Past Year
  • Issues: 9
  • Pull requests: 17
  • Average time to close issues: 5 days
  • Average time to close pull requests: about 15 hours
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 15
  • Bot issues: 0
  • Bot pull requests: 17
Top Authors
Issue Authors
  • m-muecke (21)
Pull Request Authors
  • dependabot[bot] (16)
  • pre-commit-ci[bot] (14)
  • m-muecke (2)
Top Labels
Issue Labels
Pull Request Labels
dependencies (16) github_actions (4)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 311 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 7
  • Total maintainers: 1
cran.r-project.org: bbk

Client for Central Bank APIs

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 311 Last month
Rankings
Dependent packages count: 27.8%
Dependent repos count: 35.8%
Average: 49.5%
Downloads: 84.8%
Maintainers (1)
Last synced: 11 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R >= 4.1.0 depends
  • httr2 * imports
  • xml2 * imports
  • testthat >= 3.0.0 suggests
  • tibble * suggests