Registry / finance / python-bcb

python-bcb

JSON →
library0.3.6pypypi✓ verified 82d ago

Python wrapper for the Brazilian Central Bank (BCB) API. Provides access to economic indicators, exchange rates, and time series data. Latest version: 0.3.6. Release cadence: infrequent, community-maintained.

pip install python-bcb
INSTALL
IMPORT
SIG · PYTHON-BCB
P
python-bcb
financepythonv0.3.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BCBAPIError
from bcb import BCBAPIError
from bcb import BCB
Expectativas
from bcb import Expectativas
from bcb import BCB
PTAX
from bcb import PTAX
from bcb import BCB

Instantiate BCB and fetch exchange rate data.

from bcb import BCB bcb = BCB() # Fetch USD exchange rate for a date data = bcb.get('USD', start_date='2023-01-01') print(data.head())
Debug
Known issues
breakingIn version 0.3.0, the argument 'currency' was renamed to 'code' in the `get` method. Existing code using `currency=` will fail.
fix
Replace `currency` with `code` in all BCB.get() calls.
affects: >=0.3.0
gotchaThe library returns data in pandas DataFrame format by default. If pandas is not installed, the library may silently fallback to dict/list types, causing attribute errors.
fix
Ensure pandas is installed: `pip install pandas`. Explicitly check import.
affects: all
deprecatedThe method `bcb.get_currency_codes()` is deprecated in favor of `bcb.codes()`. The old method may be removed in future versions.
fix
Use `bcb.codes()` instead of `bcb.get_currency_codes()`.
affects: >=0.3.0
Upgrade
Version history
0.3.6latest on PyPI · released Mar 27, 2026
Audit
Dependencies
requestsrequiredHTTP requests to BCB API
pandasoptionalData manipulation and time series
Agent activity
29 hits · last 30 days
node
26
Resources

No resource links recorded.

python-bcb — pip install python-bcb · libregistry