python-bcb 0.3.4__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bcb/__init__.py +4 -2
- bcb/currency.py +976 -114
- bcb/exceptions.py +22 -1
- bcb/http.py +184 -0
- bcb/odata/__init__.py +3 -1
- bcb/odata/api.py +284 -33
- bcb/odata/framework.py +359 -71
- bcb/sgs/__init__.py +448 -42
- bcb/sgs/regional_economy.py +70 -44
- bcb/utils.py +2 -0
- python_bcb-0.4.0.dist-info/METADATA +225 -0
- python_bcb-0.4.0.dist-info/RECORD +14 -0
- {python_bcb-0.3.4.dist-info → python_bcb-0.4.0.dist-info}/WHEEL +1 -1
- python_bcb-0.3.4.dist-info/METADATA +0 -81
- python_bcb-0.3.4.dist-info/RECORD +0 -13
- {python_bcb-0.3.4.dist-info → python_bcb-0.4.0.dist-info}/licenses/LICENSE +0 -0
bcb/sgs/regional_economy.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
from typing import Dict, List, Optional, Union
|
|
2
4
|
|
|
3
5
|
import pandas as pd
|
|
@@ -124,46 +126,69 @@ NON_PERFORMING_LOANS_BY_STATE_TOTAL = {
|
|
|
124
126
|
}
|
|
125
127
|
|
|
126
128
|
|
|
129
|
+
def _normalize_mode(mode: str) -> str:
|
|
130
|
+
if not isinstance(mode, str):
|
|
131
|
+
raise ValueError("mode must be one of: PF, PJ, total")
|
|
132
|
+
normalized = mode.upper()
|
|
133
|
+
if normalized == "ALL":
|
|
134
|
+
normalized = "TOTAL"
|
|
135
|
+
if normalized not in ("PF", "PJ", "TOTAL"):
|
|
136
|
+
raise ValueError("Unknown mode value, use: PF, PJ, total")
|
|
137
|
+
return normalized
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _normalize_locations(states_or_region: Union[str, List[str]]) -> List[str]:
|
|
141
|
+
locations = (
|
|
142
|
+
[states_or_region] if isinstance(states_or_region, str) else states_or_region
|
|
143
|
+
)
|
|
144
|
+
if not isinstance(locations, list) or not locations:
|
|
145
|
+
raise ValueError("At least one state or region must be provided")
|
|
146
|
+
|
|
147
|
+
normalized = []
|
|
148
|
+
for location in locations:
|
|
149
|
+
if not isinstance(location, str) or not location.strip():
|
|
150
|
+
raise ValueError(f"Not a valid state or region: {location!r}")
|
|
151
|
+
normalized.append(location.upper())
|
|
152
|
+
return normalized
|
|
153
|
+
|
|
154
|
+
|
|
127
155
|
def get_non_performing_loans_codes(
|
|
128
156
|
states_or_region: Union[str, List[str]], mode: str = "total"
|
|
129
157
|
) -> Dict[str, str]:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
location in
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
for location in states_or_region:
|
|
165
|
-
codes[location] = non_performing_loans_by_location[location]
|
|
166
|
-
return codes
|
|
158
|
+
locations = _normalize_locations(states_or_region)
|
|
159
|
+
normalized_mode = _normalize_mode(mode)
|
|
160
|
+
|
|
161
|
+
states = set(NON_PERFORMING_LOANS_BY_STATE_TOTAL)
|
|
162
|
+
regions = set(NON_PERFORMING_LOANS_BY_REGION_TOTAL)
|
|
163
|
+
invalid_locations = [
|
|
164
|
+
location
|
|
165
|
+
for location in locations
|
|
166
|
+
if location not in states and location not in regions
|
|
167
|
+
]
|
|
168
|
+
if invalid_locations:
|
|
169
|
+
raise ValueError(f"Not a valid state or region: {invalid_locations}")
|
|
170
|
+
|
|
171
|
+
# Some codes are ambiguous: "SE" is both Sergipe and Sudeste.
|
|
172
|
+
# Preserve the historical state-first behavior for all-state requests.
|
|
173
|
+
if all(location in states for location in locations):
|
|
174
|
+
mappings = {
|
|
175
|
+
"PF": NON_PERFORMING_LOANS_BY_STATE_PF,
|
|
176
|
+
"PJ": NON_PERFORMING_LOANS_BY_STATE_PJ,
|
|
177
|
+
"TOTAL": NON_PERFORMING_LOANS_BY_STATE_TOTAL,
|
|
178
|
+
}
|
|
179
|
+
elif all(location in regions for location in locations):
|
|
180
|
+
mappings = {
|
|
181
|
+
"PF": NON_PERFORMING_LOANS_BY_REGION_PF,
|
|
182
|
+
"PJ": NON_PERFORMING_LOANS_BY_REGION_PJ,
|
|
183
|
+
"TOTAL": NON_PERFORMING_LOANS_BY_REGION_TOTAL,
|
|
184
|
+
}
|
|
185
|
+
else:
|
|
186
|
+
raise ValueError("Cannot mix states and regions in the same request")
|
|
187
|
+
|
|
188
|
+
non_performing_loans_by_location = mappings[normalized_mode]
|
|
189
|
+
return {
|
|
190
|
+
location: non_performing_loans_by_location[location] for location in locations
|
|
191
|
+
}
|
|
167
192
|
|
|
168
193
|
|
|
169
194
|
def get_non_performing_loans(
|
|
@@ -192,13 +217,14 @@ def get_non_performing_loans(
|
|
|
192
217
|
|
|
193
218
|
states_or_region (List[str]): Uma lista com estado ou região.
|
|
194
219
|
mode (str): O tipo de inadimplência. Pode ser "PF" (pessoas físicas),
|
|
195
|
-
"PJ" (pessoas jurídicas)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
220
|
+
"PJ" (pessoas jurídicas), "total" ou "all"
|
|
221
|
+
(inadimplência total).
|
|
222
|
+
start : str, date, datetime or bcb.utils.Date
|
|
223
|
+
Data de início da série. Strings usam o formato ``YYYY-MM-DD``;
|
|
224
|
+
``'today'`` e ``'now'`` também são aceitos.
|
|
225
|
+
end : str, date, datetime or bcb.utils.Date
|
|
226
|
+
Data final da série. Strings usam o formato ``YYYY-MM-DD``;
|
|
227
|
+
``'today'`` e ``'now'`` também são aceitos.
|
|
202
228
|
last : int
|
|
203
229
|
Retorna os últimos ``last`` elementos disponíveis da série temporal
|
|
204
230
|
solicitada. Se ``last`` for maior que 0 (zero) os argumentos ``start``
|
bcb/utils.py
CHANGED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-bcb
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Author-email: wilsonfreitas <wilson.freitas@gmail.com>
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Requires-Dist: httpx>=0.24.0
|
|
8
|
+
Requires-Dist: lxml>=4.9.2
|
|
9
|
+
Requires-Dist: pandas>=2.0.0
|
|
10
|
+
Requires-Dist: tenacity>=8.0.0
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# python-bcb
|
|
14
|
+
|
|
15
|
+
**python-bcb** é uma interface em Python estruturada para obter informações
|
|
16
|
+
da API de dados abertos do [Banco Central do Brasil](https://www.bcb.gov.br).
|
|
17
|
+
|
|
18
|
+
[](https://pypi.python.org/pypi/python-bcb/)
|
|
19
|
+
[](https://pypi.python.org/pypi/python-bcb/)
|
|
20
|
+

|
|
21
|
+

|
|
22
|
+

|
|
23
|
+
|
|
24
|
+
O projeto de [Dados Abertos do Banco Central do Brasil](https://dadosabertos.bcb.gov.br/)
|
|
25
|
+
disponibiliza diversas APIs provendo acesso direto a dados de:
|
|
26
|
+
|
|
27
|
+
* Moedas
|
|
28
|
+
* Taxas de Juros
|
|
29
|
+
* Índices de preços
|
|
30
|
+
* Informações de Instituições Financeiras
|
|
31
|
+
* Expectativas do Mercado (Expectativas do Boletim FOCUS)
|
|
32
|
+
* E muito mais...
|
|
33
|
+
|
|
34
|
+
## Instalação
|
|
35
|
+
|
|
36
|
+
**python-bcb** está disponível no [Python Package Index](https://pypi.org/project/python-bcb/) e pode ser instalado via `pip`.
|
|
37
|
+
|
|
38
|
+
```shell
|
|
39
|
+
pip install python-bcb
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## APIs
|
|
43
|
+
|
|
44
|
+
### SGS - Sistema Gerenciador de Séries Temporais
|
|
45
|
+
|
|
46
|
+
Utiliza o webservice do SGS ([Sistema Gerenciador de Séries Temporais](https://www3.bcb.gov.br/sgspub/)) para obter dados históricos de indicadores econômicos. Oferece a maior base de dados históricos com diversas séries temporais.
|
|
47
|
+
|
|
48
|
+
### Conversor de Moedas
|
|
49
|
+
|
|
50
|
+
Implementado no módulo `currency`, realiza webscraping no site do [Conversor de Moedas](https://www.bcb.gov.br/conversao) do Banco Central. Fornece séries temporais de frequência diária de taxas de câmbio (cotações de compra e venda).
|
|
51
|
+
|
|
52
|
+
### OData - APIs Estruturadas
|
|
53
|
+
|
|
54
|
+
O Banco Central disponibiliza diversas informações em APIs que seguem o padrão [OData](https://odata.org). Inclui:
|
|
55
|
+
- **PTAX**: Boletins diários de taxas de câmbio com dados institucionalmente detalhados
|
|
56
|
+
- **Expectativas**: Expectativas de mercado coletadas do Boletim FOCUS
|
|
57
|
+
- **TaxaJuros**: Diversas taxas de juros (Selic, CDI, Cheque especial, etc.)
|
|
58
|
+
- **MercadoImobiliario**: Dados de financiamento imobiliário
|
|
59
|
+
- **IFDATA**: Informações de instituições financeiras
|
|
60
|
+
- **SPI**: Sistema de Pagamentos Instantâneos
|
|
61
|
+
|
|
62
|
+
## Qual Módulo Devo Usar?
|
|
63
|
+
|
|
64
|
+
Use esta tabela para escolher o módulo certo para seu caso de uso:
|
|
65
|
+
|
|
66
|
+
| Caso de Uso | Módulo | Características Principais |
|
|
67
|
+
|----------|--------|--------------|
|
|
68
|
+
| Séries temporais diárias (inflação, taxas de juros) | `bcb.sgs` | Maior base histórica, controle granular de frequência, múltiplas séries pré-definidas |
|
|
69
|
+
| Taxas de câmbio diárias (PTAX) | `bcb.currency` | Spreads de compra/venda, implementação rápida, frequência diária |
|
|
70
|
+
| Expectativas de mercado (Boletim FOCUS) | `bcb.odata` (Expectativas) | Indicadores de expectativas, previsões de consenso |
|
|
71
|
+
| Taxas de juros (diversos tipos) | `bcb.odata` (TaxaJuros) | Curvas detalhadas, taxas de financiamento imobiliário |
|
|
72
|
+
| Dados de financiamento imobiliário | `bcb.odata` (MercadoImobiliario) | Originações, taxas médias, volumes |
|
|
73
|
+
| Informações de instituições financeiras | `bcb.odata` (IFDATA) | Dados de balanço, informações regulatórias |
|
|
74
|
+
| Análise de dados avançada com filtros | `bcb.odata` (qualquer serviço) | API encadeável, filtragem tipo SQL, ordenação, seleção |
|
|
75
|
+
| Busca concorrente de dados | APIs assíncronas (`sgs`, `currency` e OData) | Requisições não-bloqueantes com `async_get()`, `Endpoint.async_get()` e `ODataQuery.async_collect()` |
|
|
76
|
+
|
|
77
|
+
## Início Rápido
|
|
78
|
+
|
|
79
|
+
### Séries Temporais com SGS
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from bcb import sgs
|
|
83
|
+
|
|
84
|
+
# Buscar taxa Selic (código 1)
|
|
85
|
+
df = sgs.get(1, start="2023-01-01", end="2024-12-31")
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Taxas de Câmbio com Currency
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
from bcb import currency
|
|
92
|
+
|
|
93
|
+
# Buscar preços de compra/venda do USD
|
|
94
|
+
usd = currency.get("USD", start="2023-01-01", end="2024-12-31")
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Expectativas de Mercado com OData
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
from bcb import Expectativas
|
|
101
|
+
|
|
102
|
+
api = Expectativas()
|
|
103
|
+
endpoint = api.get_endpoint("ExpectativasMercadoAnuais")
|
|
104
|
+
|
|
105
|
+
# Obter previsões do IPCA
|
|
106
|
+
df = endpoint.query().filter(endpoint.Indicador == "IPCA").limit(100).collect()
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Perguntas Frequentes
|
|
110
|
+
|
|
111
|
+
### P: Qual é a diferença entre dados de moedas do SGS e PTAX?
|
|
112
|
+
**R:** SGS contém principalmente indicadores econômicos. Para taxas de câmbio, use `bcb.currency` (dados PTAX) para cotações diárias ou o serviço `bcb.odata` PTAX para dados institucionais detalhados. O módulo currency é mais simples para casos comuns.
|
|
113
|
+
|
|
114
|
+
### P: Quão longe no tempo os dados históricos vão?
|
|
115
|
+
**R:** Varia por série:
|
|
116
|
+
- SGS: Maioria das séries remontam aos anos 1980/1990 (verifique documentação específica do código)
|
|
117
|
+
- Currency: Cotações diárias disponíveis desde aproximadamente 1980
|
|
118
|
+
- Serviços OData: Varia; consulte documentação BCB para endpoints específicos
|
|
119
|
+
|
|
120
|
+
### P: Posso buscar dados de forma assíncrona?
|
|
121
|
+
**R:** Sim. SGS e currency oferecem `async_get()`, e os endpoints OData oferecem `async_get()` e `async_collect()`. Feche o cliente assíncrono ao final de aplicações de longa duração:
|
|
122
|
+
```python
|
|
123
|
+
import asyncio
|
|
124
|
+
from bcb import http, sgs
|
|
125
|
+
|
|
126
|
+
async def main():
|
|
127
|
+
try:
|
|
128
|
+
results = await asyncio.gather(
|
|
129
|
+
sgs.async_get(1), # SELIC
|
|
130
|
+
sgs.async_get(433), # IPCA
|
|
131
|
+
)
|
|
132
|
+
return results
|
|
133
|
+
finally:
|
|
134
|
+
await http.aclose_async_client()
|
|
135
|
+
|
|
136
|
+
asyncio.run(main())
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### P: Como aumento o timeout de uma consulta lenta?
|
|
140
|
+
**R:** Passe ``timeout`` na própria chamada. O valor é local daquela chamada e
|
|
141
|
+
não altera o cliente HTTP compartilhado globalmente:
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
from bcb import sgs, currency, Expectativas
|
|
145
|
+
|
|
146
|
+
# SGS
|
|
147
|
+
selic = sgs.get(11, start="1990-01-01", timeout=120)
|
|
148
|
+
|
|
149
|
+
# Currency
|
|
150
|
+
usd = currency.get("USD", start="1980-01-01", end="2026-01-01", timeout=120)
|
|
151
|
+
|
|
152
|
+
# OData
|
|
153
|
+
em = Expectativas(timeout=120)
|
|
154
|
+
ep = em.get_endpoint("ExpectativasMercadoAnuais")
|
|
155
|
+
df = ep.query().limit(1000).collect(timeout=120)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
O padrão continua sendo 30 segundos. No SGS, o timeout vale por tentativa HTTP;
|
|
159
|
+
quando houver retry, cada tentativa usa o mesmo valor.
|
|
160
|
+
|
|
161
|
+
### P: Como trato erros e dados faltantes?
|
|
162
|
+
**R:** A biblioteca lança exceções específicas:
|
|
163
|
+
- `CurrencyNotFoundError`: Símbolo de moeda não encontrado
|
|
164
|
+
- `SGSError`: Erro do serviço SGS
|
|
165
|
+
- `BCBRateLimitError`: Limite de requisições excedido (HTTP 429)
|
|
166
|
+
- `BCBAPIError`: Outros erros de API
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
from bcb import sgs
|
|
170
|
+
from bcb.exceptions import SGSError, BCBRateLimitError
|
|
171
|
+
|
|
172
|
+
try:
|
|
173
|
+
df = sgs.get(99999) # Código inválido
|
|
174
|
+
except SGSError as e:
|
|
175
|
+
print(f"Erro de dados: {e}")
|
|
176
|
+
except BCBRateLimitError:
|
|
177
|
+
print("Limite de requisições excedido - tente novamente mais tarde")
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### P: Como habilito logging para depurar requisições?
|
|
181
|
+
**R:** A biblioteca usa o módulo logging padrão do Python:
|
|
182
|
+
```python
|
|
183
|
+
import logging
|
|
184
|
+
|
|
185
|
+
logging.basicConfig(level=logging.DEBUG)
|
|
186
|
+
logger = logging.getLogger("bcb")
|
|
187
|
+
logger.setLevel(logging.DEBUG)
|
|
188
|
+
|
|
189
|
+
# Agora todas as requisições/respostas HTTP serão registradas
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### P: Existe cache para evitar requisições redundantes?
|
|
193
|
+
**R:** Sim:
|
|
194
|
+
- `bcb.currency`: Cache em memória automático de listas de moedas
|
|
195
|
+
- `bcb.odata`: Metadados OData em cache por URL de serviço
|
|
196
|
+
- Chame `currency.clear_cache()` para resetar se dados mudarem
|
|
197
|
+
|
|
198
|
+
### P: Posso usar isso em uma aplicação de longa duração?
|
|
199
|
+
**R:** Sim, mas tenha cuidado com:
|
|
200
|
+
- Limites de requisições: APIs BCB podem ter limites; implemente backoff se necessário
|
|
201
|
+
- Cache: Cache de moedas persiste em memória; limpe se atualizações de dados importarem
|
|
202
|
+
- Pool de conexões: Usa httpx com connection pooling por padrão
|
|
203
|
+
- API Assíncrona: use métodos async para comportamento verdadeiramente não-bloqueante e chame `await bcb.http.aclose_async_client()` no encerramento de aplicações assíncronas longas
|
|
204
|
+
|
|
205
|
+
### P: Como contribuo ou reporto problemas?
|
|
206
|
+
**R:** Visite o [repositório GitHub](https://github.com/wilsonfreitas/python-bcb) para:
|
|
207
|
+
- Reportar bugs
|
|
208
|
+
- Solicitar features
|
|
209
|
+
- Enviar pull requests
|
|
210
|
+
- Ver documentação
|
|
211
|
+
|
|
212
|
+
### P: Como gero a documentação localmente?
|
|
213
|
+
**R:** As dependências de documentação ficam no grupo `docs` do `uv`:
|
|
214
|
+
```shell
|
|
215
|
+
uv run --group docs sphinx-build -b html docs docs/_build/html
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
A saída HTML é gerada em `docs/_build/html`. Edite os arquivos fonte em `docs/`; não edite os arquivos gerados em `docs/_build`.
|
|
219
|
+
|
|
220
|
+
### P: Onde encontro documentação mais detalhada?
|
|
221
|
+
**R:**
|
|
222
|
+
- [Documentação de API](https://wilsonfreitas.github.io/python-bcb/)
|
|
223
|
+
- [Diretório de Exemplos](./examples/)
|
|
224
|
+
- Docstrings inline: `help(bcb.sgs.get)`, `help(bcb.currency.get)`, etc.
|
|
225
|
+
- [Portal de Dados Abertos BCB](https://dadosabertos.bcb.gov.br/)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
bcb/__init__.py,sha256=WqaBnwklYV39rVHsIjExiC6uwGWyX6HB_fIHEaB40lc,529
|
|
2
|
+
bcb/currency.py,sha256=G9UHAszE0eeuHLT0mJ9ObwMUmJPYBC4x3aejna8O1vI,32628
|
|
3
|
+
bcb/exceptions.py,sha256=gnREvUECVbsb-f57uLSkl8hD7ITmSvXuT2y5ycpVHlk,912
|
|
4
|
+
bcb/http.py,sha256=P9btc_w6sljWXv_QsOzKt5jvCAnBMxZ6AjH6JxHvIQU,4960
|
|
5
|
+
bcb/utils.py,sha256=HHrEpEM9b2nEVmPEBU0nV__47HeAUCKkfbx9pYQhYQ4,1751
|
|
6
|
+
bcb/odata/__init__.py,sha256=O9dLRmMa6jq18ICAEK-cRfZNRJPtRFSWVqqeD_8VB98,410
|
|
7
|
+
bcb/odata/api.py,sha256=hyj1bdiVKXm5cLYrL49xk4vl3PSN2w0It5F0Sd4iaWo,28110
|
|
8
|
+
bcb/odata/framework.py,sha256=HGXOV9W0J_o8uYgGcvL63dxPfaa1mOtMdgXn1kbP4cI,28116
|
|
9
|
+
bcb/sgs/__init__.py,sha256=q_XG8m7mC89kyhoscqZmeNfIJTGIHN9fdO2ZoIw-eQk,19499
|
|
10
|
+
bcb/sgs/regional_economy.py,sha256=6lM03D0RguUujNJ_48845-WAUp40CIJkC7Fycpm9iQQ,7284
|
|
11
|
+
python_bcb-0.4.0.dist-info/METADATA,sha256=lYK93WrvmHwqBl2LjnQgutA6MfgHALUFLFoOIax8lwE,9020
|
|
12
|
+
python_bcb-0.4.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
13
|
+
python_bcb-0.4.0.dist-info/licenses/LICENSE,sha256=PK0tDWJUgRdeZCmA39ZHQu8v2ozAOl49qEaDEcntbAA,1070
|
|
14
|
+
python_bcb-0.4.0.dist-info/RECORD,,
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: python-bcb
|
|
3
|
-
Version: 0.3.4
|
|
4
|
-
Summary:
|
|
5
|
-
License-File: LICENSE
|
|
6
|
-
Author: wilsonfreitas
|
|
7
|
-
Author-email: wilson.freitas@gmail.com
|
|
8
|
-
Requires-Python: >=3.10
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
-
Requires-Dist: httpx (>=0.24.0)
|
|
16
|
-
Requires-Dist: lxml (>=4.9.2)
|
|
17
|
-
Requires-Dist: pandas (>=2.0.0)
|
|
18
|
-
Description-Content-Type: text/markdown
|
|
19
|
-
|
|
20
|
-
# python-bcb
|
|
21
|
-
|
|
22
|
-
**python-bcb** é uma interface em Python estruturada para obter informações
|
|
23
|
-
da API de dados abertos do [Banco Central do Brasil](https://www.bcb.gov.br).
|
|
24
|
-
|
|
25
|
-
[](https://pypi.python.org/pypi/python-bcb/)
|
|
26
|
-
[](https://pypi.python.org/pypi/python-bcb/)
|
|
27
|
-

|
|
28
|
-

|
|
29
|
-

|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
O projeto de [Dados Abertos do Banco Central do Brasil](https://dadosabertos.bcb.gov.br/)
|
|
33
|
-
disponibiliza diversas APIs provendo acesso direto a dados de:
|
|
34
|
-
|
|
35
|
-
* Moedas
|
|
36
|
-
* Taxas de Juros
|
|
37
|
-
* Índices de preços
|
|
38
|
-
* Informações de Instituições Financeiras
|
|
39
|
-
* Expectativas do Mercado (Expectativas do Boletim FOCUS)
|
|
40
|
-
* E muito outros ...
|
|
41
|
-
|
|
42
|
-
# Instalação
|
|
43
|
-
|
|
44
|
-
**python-bcb** está disponível no [Python Package Index](https://pypi.org/project/python-bcb/) e pode ser instalado via `pip` usando.
|
|
45
|
-
|
|
46
|
-
```shell
|
|
47
|
-
pip install python-bcb
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
# APIs
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## SGS
|
|
54
|
-
Utiliza o webservice do SGS
|
|
55
|
-
([Sistema Gerenciador de Séries Temporais](https://www3.bcb.gov.br/sgspub/))
|
|
56
|
-
para obter os dados.
|
|
57
|
-
|
|
58
|
-
## Conversor de Moedas
|
|
59
|
-
|
|
60
|
-
Implementado no módulo `currency`, um conjunto de funções que realiza webscraping
|
|
61
|
-
no site do [Conversor de Moedas](https://www.bcb.gov.br/conversao)
|
|
62
|
-
do Banco Central, possível obter séries temporais de frequência diária
|
|
63
|
-
de diversas moedas.
|
|
64
|
-
|
|
65
|
-
## Moedas OData
|
|
66
|
-
|
|
67
|
-
O Banco Central disponibiliza diversas informações em APIs que
|
|
68
|
-
seguem o padrão [OData](https://odata.org).
|
|
69
|
-
A classe `bcb.PTAX` implementa uma API OData que
|
|
70
|
-
entrega os boletins diários de taxas de câmbio do Banco Central.
|
|
71
|
-
Esta API entrega mais informações do que o que é obtido no
|
|
72
|
-
`Conversor de Moedas`.
|
|
73
|
-
|
|
74
|
-
## Expectativas
|
|
75
|
-
|
|
76
|
-
A API de Expectativas de Mercado traz todas as estatísticas das variáveis
|
|
77
|
-
macroeconômicas fornecidos por um conjuto de instituições do mercado
|
|
78
|
-
financeiro.
|
|
79
|
-
A classe `bcb.Expectativas` implementa essa interface no
|
|
80
|
-
padrão OData.
|
|
81
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
bcb/__init__.py,sha256=5L_MdfdTJSSOtNzwRp70bffQHQeiEzE2EwOesa7UcUI,487
|
|
2
|
-
bcb/currency.py,sha256=lRlbjoqsEbHuYJRJ-gmUGpJwHRy4eqTUaMWxpiURuhI,7555
|
|
3
|
-
bcb/exceptions.py,sha256=_LwjDQJSuQ0DEaxWqnqeW3kyfcbroBBHd5Lwl5T4Qic,557
|
|
4
|
-
bcb/odata/__init__.py,sha256=KLST8kgN_vk0YcNrZ-GHXHhfGTzDXXGfi71J5FCTvmc,365
|
|
5
|
-
bcb/odata/api.py,sha256=vGZA8z4MsWl_L90iy9o7sercQXmvtdFh3jskMk7pySs,19081
|
|
6
|
-
bcb/odata/framework.py,sha256=JmSid8AFmNw9O0uKAGEE3_LmuyJaaLSSDh469qaQLNo,17675
|
|
7
|
-
bcb/sgs/__init__.py,sha256=hbJrkUO4FUFqOEAqgEvHER95xVVEL9_N-3LAWitmV5E,6823
|
|
8
|
-
bcb/sgs/regional_economy.py,sha256=US5DpNyJ28V-Rh9UDKQPmWyFLjkQTNrRW56MvSS_qPA,6265
|
|
9
|
-
bcb/utils.py,sha256=SZiOAwwWA7fP3ztVMkdpQaBjUan0t_F2mFxOJXoTRdc,1715
|
|
10
|
-
python_bcb-0.3.4.dist-info/METADATA,sha256=RRUUGkwMrxgWItRpHAhCofOk6CSWWh7_vetJt_BvB2o,2812
|
|
11
|
-
python_bcb-0.3.4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
12
|
-
python_bcb-0.3.4.dist-info/licenses/LICENSE,sha256=PK0tDWJUgRdeZCmA39ZHQu8v2ozAOl49qEaDEcntbAA,1070
|
|
13
|
-
python_bcb-0.3.4.dist-info/RECORD,,
|
|
File without changes
|