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
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,28 @@ async def main():
asyncio.run(main())
```

### P: Como aumento o timeout de uma consulta lenta?
**R:** Passe ``timeout`` na própria chamada. O valor é local daquela chamada e
não altera o cliente HTTP compartilhado globalmente:

```python
from bcb import sgs, currency, Expectativas

# SGS
selic = sgs.get(11, start="1990-01-01", timeout=120)

# Currency
usd = currency.get("USD", start="1980-01-01", end="2026-01-01", timeout=120)

# OData
em = Expectativas(timeout=120)
ep = em.get_endpoint("ExpectativasMercadoAnuais")
df = ep.query().limit(1000).collect(timeout=120)
```

O padrão continua sendo 30 segundos. No SGS, o timeout vale por tentativa HTTP;
quando houver retry, cada tentativa usa o mesmo valor.

### P: Como trato erros e dados faltantes?
**R:** A biblioteca lança exceções específicas:
- `CurrencyNotFoundError`: Símbolo de moeda não encontrado
Expand Down
Loading
Loading