skillfed

python-bcb

python-bcb v0.4.0 110.4K downloads/30d#12,465 on PyPI
License unclear Active released

What it is and what it does

python-bcb is a Python wrapper for the Brazilian Central Bank's open data APIs, providing structured access to economic and financial datasets. It abstracts three main data sources: SGS (time-series economic indicators like interest rates and inflation), a currency converter for daily exchange rates, and OData endpoints for market expectations, interest rates, real estate financing, and financial institution data.

The package handles HTTP requests via httpx with connection pooling, parses responses into pandas DataFrames, and supports both synchronous and asynchronous retrieval. It includes built-in retry logic via tenacity, caches metadata where appropriate, and raises specific exceptions for common failure modes (rate limits, invalid series codes, missing currencies). Typical use is fetching historical economic time series for analysis, but it also supports ad-hoc queries with SQL-like filtering on OData endpoints.

Use it for:

  • Fetch historical Selic or IPCA rates for inflation and interest rate analysis.
  • Retrieve daily USD/BRL exchange rates with buy/sell spreads for currency trading or financial reporting.
  • Query market consensus forecasts from the FOCUS bulletin for economic scenario planning.
  • Build dashboards or reports aggregating multiple BCB data sources concurrently with async methods.
  • Access real estate financing data and financial institution balance sheets for regulatory or research analysis.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Structured Python interface to fetch Brazilian Central Bank open data APIs, including time series, exchange rates, market expectations, and financial institution information.

Yes, if you need Brazilian Central Bank data. The package is actively maintained, has low install friction, and provides a clean interface to otherwise fragmented APIs. License treatment is unclear, so verify terms before use in proprietary projects. No known vulnerabilities. Requires Python 3.10+.

Install

python-bcb on PyPI

pip

pip install python-bcb

uv

uv add python-bcb

poetry

poetry add python-bcb

Installing python-bcb

Before you install

Low install friction with a pure-wheel distribution. Active maintenance with a release 60 days ago. Requires Python 3.10 or later.

Quickstart

pip install python-bcb

from bcb import sgs
df = sgs.get(1, start="2023-01-01", end="2024-12-31")

Requires Python 3.10 or later.

Verify before relying

  • License classification is unclear in the fact sheet; verify actual license terms before use in proprietary or GPL-incompatible projects.
  • Rate limiting behavior and retry strategy details are not specified; confirm handling for production workloads.
  • Async API stability and connection pooling behavior under sustained load are not documented in the fact sheet.

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — httpx, lxml, pandas, tenacity
Maintenance actively maintained — 60 days since the last release
First released
Downloads 110,379/month — #12,465 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_bcb-0.4.0-py3-none-any.whl

Tags

brazilian central bank data apibcb exchange rates pythoneconomic indicators time seriesbrazil financial data accessodata api wrapper python
financial-databrazilodata

More WWW/HTTP packages