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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Ideias / discussão aberta
url: https://github.com/robertoecf/findata-br/discussions
url: https://github.com/robertoecf/openfindata/discussions
about: Pergunte, sugira ou discuta rumos do projeto sem abrir bug/feature.
- name: Deploy público / MCP server
url: https://github.com/robertoecf/findata-br/blob/main/docs/DEPLOY_PUBLIC.md
url: https://github.com/robertoecf/openfindata/blob/main/docs/DEPLOY_PUBLIC.md
about: Guia passo-a-passo pra você subir seu próprio MCP server em WSL + Cloudflare Tunnel.
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ reproducible data work.
- Canonical working directory: the repository root, i.e. the directory that
contains this `AGENTS.md`.
- Project name: Dados Financeiros Abertos.
- Distribution/package slug: `findata-br`.
- Distribution/package slug: `openfindata`.
- Import package and CLI remain `findata` for compatibility.
- Scope: Python library + REST API + MCP server + CLI for Brazilian public
financial data.
Expand Down Expand Up @@ -106,7 +106,7 @@ Minimum information contract for every chart:

- clear title stating exactly what is compared;
- frequency and period;
- primary source/curation: `Dados Financeiros Abertos (findata-br)`;
- primary source/curation: `Dados Financeiros Abertos (openfindata)`;
- extraction timestamp in BRT;
- effective data cutoff: first and last date actually plotted;
- original source subsets/series identifiers, such as `BCB SGS 432` or
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Changed

- **Distribution slug renamed `findata-br` → `openfindata`.** The PyPI
distribution name is now `openfindata` (`pip install openfindata`,
`pip install 'openfindata[b3]'`), aligning the package slug with the
GitHub repository and echoing the OpenBB-style `open*` convention. The
importable package and CLI are unchanged (`import findata`, `findata …`).
Deploy artifacts follow suit: `deploy/openfindata.service` (renamed from
`deploy/findata-br.service`) and the default container/working-dir names.

### Added

- **ANBIMA Títulos Públicos (TPF) secondary market** — `get_tpf()`,
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Comportamentos inaceitáveis:
## Aplicação

Casos podem ser reportados em privado abrindo uma
[GitHub Discussion privada](https://github.com/robertoecf/findata-br/discussions)
[GitHub Discussion privada](https://github.com/robertoecf/openfindata/discussions)
ou direto para [@robertoecf](https://github.com/robertoecf).

Todas as reclamações serão revisadas e investigadas.
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
## Setup em 30 segundos

```bash
git clone https://github.com/robertoecf/findata-br.git
cd findata-br
git clone https://github.com/robertoecf/openfindata.git
cd openfindata
python3 -m venv .venv
. .venv/bin/activate
pip install -e '.[dev]'
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Infraestrutura open source para consultar dados financeiros públicos do Brasil em
Python, REST, CLI e MCP.

[![CI](https://img.shields.io/github/actions/workflow/status/robertoecf/findata-br/ci.yml?branch=main&label=CI&logo=github)](https://github.com/robertoecf/findata-br/actions/workflows/ci.yml)
[![CI](https://img.shields.io/github/actions/workflow/status/robertoecf/openfindata/ci.yml?branch=main&label=CI&logo=github)](https://github.com/robertoecf/openfindata/actions/workflows/ci.yml)
![Versão](https://img.shields.io/badge/versão-0.3.1--alpha-009c3b)
![Python](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-blue?logo=python&logoColor=white)
[![Licença MIT](https://img.shields.io/badge/licença-MIT-yellow.svg)](LICENSE)
Expand All @@ -21,20 +21,20 @@ analistas, desenvolvedores, pesquisadores e agentes:
- registro local para resolver CNPJ, ticker e nome.

As fontes principais não exigem chaves de API e os testes unitários não acessam a
rede. O slug de distribuição continua sendo `findata-br`; o pacote importável e a
rede. O slug de distribuição é `openfindata`; o pacote importável e a
CLI continuam sendo `findata`.

## Instalação

```bash
pip install findata-br
pip install openfindata
```

Para desenvolvimento local:

```bash
git clone https://github.com/robertoecf/findata-br.git
cd findata-br
git clone https://github.com/robertoecf/openfindata.git
cd openfindata
pip install -e '.[dev]'
bash scripts/git/install-hooks.sh
```
Expand Down
12 changes: 6 additions & 6 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Status: **v0.1.0 — alpha, release-ready for local/self-hosted use.**
1. **Run the server on WSL**
```bash
# in WSL
git clone https://github.com/robertoecf/findata-br.git
cd findata-br
git clone https://github.com/robertoecf/openfindata.git
cd openfindata
python3 -m venv .venv && . .venv/bin/activate
pip install -e .
findata serve --host 0.0.0.0 --port 8000
Expand All @@ -35,7 +35,7 @@ Status: **v0.1.0 — alpha, release-ready for local/self-hosted use.**
```

3. **Publish to PyPI**
- Reserve the name: <https://pypi.org/project/findata-br/>
- Reserve the name: <https://pypi.org/project/openfindata/>
- Create a release: `git tag v0.1.0 && git push --tags`
- Add a `release.yml` workflow that runs on tags and publishes via
[trusted publishing](https://docs.pypi.org/trusted-publishers/).
Expand All @@ -50,8 +50,8 @@ Status: **v0.1.0 — alpha, release-ready for local/self-hosted use.**
[Service]
Type=simple
User=yourself
WorkingDirectory=/srv/findata-br
ExecStart=/srv/findata-br/.venv/bin/findata serve --host 0.0.0.0 --port 8000 --no-banner
WorkingDirectory=/srv/openfindata
ExecStart=/srv/openfindata/.venv/bin/findata serve --host 0.0.0.0 --port 8000 --no-banner
Restart=on-failure

[Install]
Expand Down Expand Up @@ -115,7 +115,7 @@ ideas are worth copying:
- **Fund daily NAV** files are ~50 MB/month — same recommendation: filter by
`cnpj=`.
- **yfinance** is a core dependency since v0.1.0; if you use
`pip install findata-br --no-deps` and skip it, `/b3/*` returns `503`.
`pip install openfindata --no-deps` and skip it, `/b3/*` returns `503`.
- **fastapi-mcp** is pinned at a minimum version; if your deployment picks up
a major-version break, `/mcp` is silently disabled but the REST API keeps
serving.
6 changes: 3 additions & 3 deletions deploy/docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ services:
build:
context: ..
dockerfile: Dockerfile
image: findata-br:latest
container_name: findata-br
image: openfindata:latest
container_name: openfindata
restart: unless-stopped
# Publish only on loopback — Cloudflare Tunnel reaches in via `cloudflared`.
# Change to "0.0.0.0:8000:8000" if you terminate TLS with your own nginx.
Expand Down Expand Up @@ -40,7 +40,7 @@ services:
# CF_TUNNEL_TOKEN in .env (or swap for `tunnel run --token $TOKEN`).
cloudflared:
image: cloudflare/cloudflared:latest
container_name: findata-br-tunnel
container_name: openfindata-tunnel
restart: unless-stopped
depends_on:
findata:
Expand Down
10 changes: 5 additions & 5 deletions deploy/findata-br.service → deploy/openfindata.service
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[Unit]
Description=Dados Financeiros Abertos — open-source Brazilian financial data MCP server
Documentation=https://github.com/robertoecf/findata-br
Documentation=https://github.com/robertoecf/openfindata
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=findata
Group=findata
WorkingDirectory=/opt/findata-br
Environment="PATH=/opt/findata-br/.venv/bin:/usr/local/bin:/usr/bin:/bin"
WorkingDirectory=/opt/openfindata
Environment="PATH=/opt/openfindata/.venv/bin:/usr/local/bin:/usr/bin:/bin"
# Rate-limit tuning for public deploys. Override in a drop-in override.conf
# if you want tighter/looser buckets per deployment.
Environment="FINDATA_RATE_LIMIT_DEFAULT=60/minute;1000/day"
Environment="FINDATA_RATE_LIMIT_ENABLED=true"
ExecStart=/opt/findata-br/.venv/bin/findata serve --host 0.0.0.0 --port 8000 --no-banner
ExecStart=/opt/openfindata/.venv/bin/findata serve --host 0.0.0.0 --port 8000 --no-banner
Restart=on-failure
RestartSec=5
# Security hardening — read-only service talking to public APIs only.
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/log/findata-br
ReadWritePaths=/var/log/openfindata
ProtectKernelTunables=true
ProtectControlGroups=true
MemoryMax=512M
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
services:
findata:
build: .
image: findata-br:latest
container_name: findata-br
image: openfindata:latest
container_name: openfindata
ports:
- "8000:8000"
restart: unless-stopped
Expand Down
12 changes: 6 additions & 6 deletions docs/CHART_STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ anexos ao artefato, os itens abaixo.
2. **Frequência e período**: informar a periodicidade e o intervalo apresentado,
por exemplo `Dados mensais: jan/2016 a abr/2026`.
3. **Fonte primária/curadoria do repo**:
`Dados Financeiros Abertos (findata-br)` apontando para
`https://github.com/robertoecf/findata-br`.
`Dados Financeiros Abertos (openfindata)` apontando para
`https://github.com/robertoecf/openfindata`.
4. **Extração**: timestamp da extração em BRT. Use formato explícito, por
exemplo `2026-05-11 14:32:05 BRT` ou `11/05/2026, 14:32:05 BRT`.
5. **Recorte efetivo dos dados**: primeira e última data realmente plotadas após
Expand Down Expand Up @@ -76,7 +76,7 @@ Dados mensais: jan/2016 a abr/2026. Selic = BCB SGS 432; Ibovespa = B3.
Todo gráfico deve mostrar ou anexar estes campos:

```text
Fonte primária: Dados Financeiros Abertos (findata-br)
Fonte primária: Dados Financeiros Abertos (openfindata)
Extração: 2026-05-11 14:32:05 BRT
Recorte dos dados: 2016-01-31 -> 2026-04-30
```
Expand All @@ -92,14 +92,14 @@ Formato recomendado:

```text
Fontes dos dados. Fonte primária/curadoria:
Dados Financeiros Abertos (findata-br).
Dados Financeiros Abertos (openfindata).
Subsets originais: BCB SGS 432 para Selic meta; B3 IndexStatisticsProxy para Ibovespa.
```

A fonte primária deve apontar para:

```text
https://github.com/robertoecf/findata-br
https://github.com/robertoecf/openfindata
```

### Linha técnica final
Expand Down Expand Up @@ -229,7 +229,7 @@ artefato para permitir regeneração.
## Regra de fonte primária

Para artefatos gerados pelo projeto, a fonte primária/curadoria é sempre o
Dados Financeiros Abertos (`findata-br`). As fontes externas aparecem como
Dados Financeiros Abertos (`openfindata`). As fontes externas aparecem como
subsets originais, com identificadores auditáveis, por exemplo:

- `BCB SGS 432` para Selic meta;
Expand Down
32 changes: 16 additions & 16 deletions docs/DEPLOY_PUBLIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ TLS, filtra bots, serve a URL `*.seudominio.com.br`.
```bash
# dentro do WSL
cd ~
git clone https://github.com/robertoecf/findata-br.git
cd findata-br
git clone https://github.com/robertoecf/openfindata.git
cd openfindata
docker compose -f deploy/docker-compose.prod.yml build
```

### 2. Cadastre o Tunnel na Cloudflare

1. Entre em <https://one.dash.cloudflare.com> → **Networks** → **Tunnels** → **Create a tunnel**.
2. Escolha **Cloudflared**, dê um nome (ex.: `findata-br`).
2. Escolha **Cloudflared**, dê um nome (ex.: `openfindata`).
3. Copie o **Tunnel Token** (string longa começando com `ey...`).
4. Na aba **Public Hostname** configure uma rota:
- Subdomain: `findata`
Expand Down Expand Up @@ -89,17 +89,17 @@ Use se quiser menos overhead ou se Docker Desktop te irrita.
### 1. Crie usuário e diretório

```bash
sudo useradd --system --create-home --home-dir /opt/findata-br findata
sudo mkdir -p /var/log/findata-br
sudo chown findata:findata /var/log/findata-br
sudo useradd --system --create-home --home-dir /opt/openfindata findata
sudo mkdir -p /var/log/openfindata
sudo chown findata:findata /var/log/openfindata
```

### 2. Instale o Dados Financeiros Abertos

```bash
sudo -u findata bash <<'EOF'
cd /opt/findata-br
git clone https://github.com/robertoecf/findata-br.git .
cd /opt/openfindata
git clone https://github.com/robertoecf/openfindata.git .
python3 -m venv .venv
. .venv/bin/activate
pip install -e .
Expand All @@ -109,10 +109,10 @@ EOF
### 3. Ative o serviço

```bash
sudo cp /opt/findata-br/deploy/findata-br.service /etc/systemd/system/
sudo cp /opt/openfindata/deploy/openfindata.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now findata-br
sudo systemctl status findata-br
sudo systemctl enable --now openfindata
sudo systemctl status openfindata
```

### 4. Instale o cloudflared
Expand All @@ -126,11 +126,11 @@ sudo apt install cloudflared
cloudflared tunnel login

# Cria o tunnel e anota o UUID
cloudflared tunnel create findata-br
cloudflared tunnel create openfindata

# Config em ~/.cloudflared/config.yml:
cat > ~/.cloudflared/config.yml <<EOF
tunnel: findata-br
tunnel: openfindata
credentials-file: /home/$USER/.cloudflared/<UUID>.json

ingress:
Expand All @@ -140,7 +140,7 @@ ingress:
EOF

# DNS automático
cloudflared tunnel route dns findata-br findata.seudominio.com.br
cloudflared tunnel route dns openfindata findata.seudominio.com.br

# Instala como serviço systemd
sudo cloudflared service install
Expand Down Expand Up @@ -174,7 +174,7 @@ Depois que a URL pública estiver respondendo, adicione em
```jsonc
{
"mcpServers": {
"findata-br": {
"openfindata": {
"url": "https://findata.seudominio.com.br/mcp"
}
}
Expand All @@ -194,7 +194,7 @@ usá-las automaticamente quando você perguntar coisas como:
- `GET /health` — liveness probe (usar pra uptime monitors tipo BetterStack/UptimeRobot).
- `GET /stats` — snapshot (uptime, cache, versão, se rate-limit ativo).
- `GET /docs` — Swagger UI interativo pro endpoint público.
- Logs: `docker compose logs -f findata` ou `journalctl -u findata-br -f`.
- Logs: `docker compose logs -f findata` ou `journalctl -u openfindata -f`.

### Uptime monitor grátis

Expand Down
4 changes: 2 additions & 2 deletions docs/SOURCES_WITH_AUTH.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
> **Status atual: nenhuma fonte ativa exige credenciais.** O Dados Financeiros Abertos é
> 100% public-data — todas as 11 fontes públicas online (BCB, CVM, B3, IBGE,
> IPEA, Tesouro, ANBIMA, Receita Federal, ANEEL, SUSEP e Open Finance Brasil)
> funcionam apenas com `pip install findata-br`, sem env vars, sem cadastro,
> funcionam apenas com `pip install openfindata`, sem env vars, sem cadastro,
> sem chave de API. O registro local também funciona offline. Este documento existe pra registrar o
> _framework_ que está pronto pra ser usado quando alguém da comunidade
> integrar uma fonte que de fato exija auth (SUSEP, BNDES, etc.).
Expand Down Expand Up @@ -78,7 +78,7 @@ Para consultas BigQuery locais, use o extra opcional e um projeto de billing do
próprio operador:

```bash
pip install 'findata-br[basedosdados]'
pip install 'openfindata[basedosdados]'
export FINDATA_BD_BILLING_PROJECT_ID="seu-projeto-gcp"
findata basedosdados query 'SELECT * FROM `basedosdados.br_bd_diretorios_brasil.municipio` LIMIT 5'
```
Expand Down
2 changes: 1 addition & 1 deletion docs/SOURCE_PRIORITIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is the current short list for agent-facing source work.
Base dos Dados is now a supported `free_logged_in` source through BigQuery and
public catalog search. It does not replace canonical official-source adapters;
it adds BigQuery-native joins, microdata-scale exploration, treated datasets and
coverage not yet present in findata-br. The curated finance/economics map lives
coverage not yet present in openfindata. The curated finance/economics map lives
in `docs/source-notes/basedosdados.md`.

Use it to prioritize datasets such as Selic, câmbio, IPCA/IPCA-15/INPC/IGP,
Expand Down
Loading
Loading