Skip to content

Releases: TeodoroRodrigo/bcbpy

v2.0.0

20 Apr 15:33

Choose a tag to compare

Changelog

[v2.0.0] - Renamed to bcbpy

Changed (breaking)

  • Project renamed from bcb-sgs to bcbpy. This is a breaking change for imports and installation:
    • PyPI distribution: pip install bcb-sgspip install bcbpy
    • Python import: from bcb_sgs import ...from bcbpy import ...
    • GitHub repository: TeodoroRodrigo/bcb-sgsTeodoroRodrigo/bcbpy
  • Updated all documentation, examples, project URLs, and GitHub Actions environment targets to reflect the new name

Migration

# old
from bcb_sgs import fetch_series, INTEREST_RATES

# new
from bcbpy import fetch_series, INTEREST_RATES

Full Changelog: v1.1.1...v2.0.0

v1.0.0 — Initial Release

13 Apr 15:06

Choose a tag to compare

bcb_sgs v1.0.0

Full Python client for the BCB SGS (Sistema Gerenciador de Series Temporais) API from the Banco Central do Brasil.

Highlights

  • 115 curated series codes organized in 14 categories: Exchange Rates, Interest Rates (Selic, CDI, TR), Inflation (IPCA, IGP-M, INPC), GDP, Employment, Industrial Production, Financial Markets, Savings, Confidence, Economic Activity, Basic Basket, and more
  • 5 client functions: fetch_series, fetch_last, fetch_multiple, list_codes, search_codes
  • Flexible date handling — accepts both YYYY-MM-DD and DD/MM/YYYY, with 10-year range validation
  • Error handlingSGSError, SGSRateLimitError, SGSEmptyResponseError
  • 50 tests — 43 unit tests (mocked) + 7 integration tests (live API)

Quick Start

pip install -r requirements.txt
from bcb_sgs import fetch_series, fetch_last, INTEREST_RATES, EXCHANGE_RATES

# Last 10 CDI daily rates
cdi = fetch_last(INTEREST_RATES["CDI_DAILY"], n=10)

# USD/BRL for 2024
usd = fetch_series(EXCHANGE_RATES["USD_SALE_DAILY"], start_date="2024-01-01", end_date="2024-12-31")

See README.md for full documentation and CHANGELOG.md for details.