Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## [v3.0.0] - Unreleased
## [v2.3.0] - 2026-10-07

### Added
- Editable SVG project icon in `docs/bcbpy-icon.svg`, following the Homepy visual style.
- Centered README icon, badges, and feature highlights.

### Changed (breaking)
- Rename misleading registry keys to match live SGS metadata (issue #10):
Expand All @@ -12,7 +16,7 @@
- `REER_BASKET` (11752) remains the effective index; the four `RER_*` indices are bilateral. All five use IPCA and June 1994 = 100.

### Migration
- Replace category and `ALL_CODES` key lookups, saved names, and search terms using the [README migration table](README.md#migrating-to-30).
- Replace category and `ALL_CODES` key lookups, saved names, and search terms using the [README migration table](README.md#migrating-to-23).
- Numeric SGS codes, the 114-series count, and fetch behavior are unchanged. No compatibility aliases are retained.

## [v2.2.0] - 2026-09-23
Expand Down
46 changes: 39 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
# bcbpy

Python client for the **BCB SGS** (Sistema Gerenciador de Series Temporais) API from the [Banco Central do Brasil](https://dadosabertos.bcb.gov.br/).

Fetch Brazilian economic and financial time series as pandas DataFrames with a simple, Pythonic interface. Includes **114 curated series codes** covering exchange rates, interest rates, inflation, GDP, employment, and more.
<p align="center">
<img src="https://raw.githubusercontent.com/rteoo/bcbpy/main/docs/bcbpy-icon.svg" width="128" alt="bcbpy time-series icon">
</p>

<p align="center">
A Python client for Banco Central do Brasil's SGS API, with pandas DataFrames,
raw data provenance, and 114 curated economic series.
</p>

<p align="center">
<a href="https://github.com/rteoo/bcbpy/actions/workflows/tests.yml"><img src="https://github.com/rteoo/bcbpy/actions/workflows/tests.yml/badge.svg" alt="Test status"></a>
<a href="https://pypi.org/project/bcbpy/"><img src="https://img.shields.io/pypi/v/bcbpy?label=PyPI" alt="PyPI version"></a>
<a href="https://pypi.org/project/bcbpy/"><img src="https://img.shields.io/pypi/pyversions/bcbpy" alt="Supported Python versions"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT license"></a>
</p>

Fetch Brazilian economic and financial time series from the
[Banco Central do Brasil](https://dadosabertos.bcb.gov.br/) SGS
(Sistema Gerenciador de Séries Temporais) API. Read exchange rates, interest
rates, inflation, GDP, employment, and more from Python without an API key.

## Highlights

- Date-indexed pandas DataFrames for individual series, recent observations,
and multiple series merged into one table.
- **114 curated series codes across 14 categories**, plus keyword search and
direct numeric SGS-code access.
- Raw payloads with request metadata, retrieval time, SHA-256, and parser
version for reproducible data pipelines.
- Automatic partitioning of raw date ranges longer than SGS's 10-year
single-query limit.
- Explicit HTTP and rate-limit errors, including `Retry-After` when provided.

## Installation

Expand Down Expand Up @@ -181,12 +210,13 @@ fetch_series(433)
fetch_series(INFLATION["IPCA"])
```

### Migrating to 3.0
### Migrating to 2.3

Version 3.0 renames seven registry keys to match the SGS series names. Update
dictionary lookups and any saved key names using this table:
Version 2.3 renames seven registry keys to match the SGS series names.
**These are breaking changes to registry lookups.** Update dictionary lookups
and any saved key names using this table:

| Category | Old key (2.x) | New key (3.0) | SGS code |
| Category | Old key (2.2 and earlier) | New key (2.3) | SGS code |
|----------|---------------|---------------|----------|
| `EMPLOYMENT` | `AVG_NOMINAL_INCOME` | `AVG_REAL_HABITUAL_INCOME` | 24382 |
| `INTEREST_RATES` | `SELIC_OVERNIGHT_ANNUAL` | `SELIC_MONTHLY_ANNUALIZED` | 4189 |
Expand Down Expand Up @@ -245,6 +275,8 @@ bcbpy/
│ ├── client.py # API client functions and exceptions
│ ├── codes.py # 114 curated series codes in 14 categories
│ └── constants.py # Base URLs and API configuration
├── docs/
│ └── bcbpy-icon.svg # Editable project icon
├── pyproject.toml # PyPI packaging metadata
├── BCB_API_REFERENCE.md # SGS API reference and series code table
└── README.md
Expand Down
2 changes: 1 addition & 1 deletion bcbpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
df = fetch_multiple({"CDI": 12, "SELIC": 11}, start_date="2024-01-01")
"""

__version__ = "3.0.0"
__version__ = "2.3.0"

from .artifacts import RawResult
from .client import (
Expand Down
39 changes: 39 additions & 0 deletions docs/bcbpy-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading