From b725c32dc39dd56743356ff768606fa6c003f238 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 25 Jun 2026 03:34:11 +0000 Subject: [PATCH] build: rename distribution slug findata-br -> openfindata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PyPI distribution name becomes `openfindata`, aligning the package slug with the GitHub repository (robertoecf/openfindata) and echoing the OpenBB-style `open*` convention. The importable package and CLI are unchanged (`import findata`, `findata ...`) — only the install slug moves (`pip install openfindata`, `pip install 'openfindata[b3]'`). Swept all references: pyproject name + URLs, README/ROADMAP/docs install instructions and repo links, web templates and chart-explorer source labels, USER_AGENT, _PROJECT_SLUG, and the slug assertions in tests. Renamed deploy/findata-br.service -> deploy/openfindata.service and updated container/working-dir names. CHANGELOG history left intact; a new Unreleased "Changed" entry documents the rename. Tests: 231 passed. ruff: clean. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01VHpJgPMzzpraMW38wBorK8 --- .github/ISSUE_TEMPLATE/config.yml | 4 +-- AGENTS.md | 4 +-- CHANGELOG.md | 10 ++++++ CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 4 +-- README.md | 10 +++--- ROADMAP.md | 12 +++---- deploy/docker-compose.prod.yml | 6 ++-- ...findata-br.service => openfindata.service} | 10 +++--- docker-compose.yml | 4 +-- docs/CHART_STANDARDS.md | 12 +++---- docs/DEPLOY_PUBLIC.md | 32 +++++++++---------- docs/SOURCES_WITH_AUTH.md | 4 +-- docs/SOURCE_PRIORITIES.md | 2 +- docs/source-notes/basedosdados.md | 10 +++--- pyproject.toml | 10 +++--- scripts/benchmark_public_surface.py | 2 +- src/findata/api/app.py | 2 +- src/findata/api/routers/b3.py | 2 +- src/findata/http_client.py | 2 +- src/findata/sources/b3/quotes.py | 4 +-- src/findata/sources/basedosdados/catalog.py | 4 +-- src/findata/web/static/chart-explorer.js | 14 ++++---- src/findata/web/static/site.js | 2 +- src/findata/web/templates/charts.html | 14 ++++---- src/findata/web/templates/docs.html | 14 ++++---- src/findata/web/templates/index.html | 12 +++---- tests/test_api.py | 6 ++-- tests/test_basedosdados.py | 4 +-- tests/test_benchmark_public_surface.py | 2 +- 30 files changed, 115 insertions(+), 105 deletions(-) rename deploy/{findata-br.service => openfindata.service} (71%) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 3836625..c56a3a1 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -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. diff --git a/AGENTS.md b/AGENTS.md index 2ee05c6..20db87b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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. @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2af4a22..f12ff64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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()`, diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 637bc22..83bfefe 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a58d49..c4718da 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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]' diff --git a/README.md b/README.md index dbc601c..461787d 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 ``` diff --git a/ROADMAP.md b/ROADMAP.md index 7ffc047..9fc43a9 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -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 @@ -35,7 +35,7 @@ Status: **v0.1.0 — alpha, release-ready for local/self-hosted use.** ``` 3. **Publish to PyPI** - - Reserve the name: + - Reserve the name: - 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/). @@ -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] @@ -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. diff --git a/deploy/docker-compose.prod.yml b/deploy/docker-compose.prod.yml index 46a55d9..ddd1618 100644 --- a/deploy/docker-compose.prod.yml +++ b/deploy/docker-compose.prod.yml @@ -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. @@ -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: diff --git a/deploy/findata-br.service b/deploy/openfindata.service similarity index 71% rename from deploy/findata-br.service rename to deploy/openfindata.service index a4e1f23..5e44d68 100644 --- a/deploy/findata-br.service +++ b/deploy/openfindata.service @@ -1,6 +1,6 @@ [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 @@ -8,13 +8,13 @@ Wants=network-online.target 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. @@ -22,7 +22,7 @@ NoNewPrivileges=true PrivateTmp=true ProtectSystem=strict ProtectHome=true -ReadWritePaths=/var/log/findata-br +ReadWritePaths=/var/log/openfindata ProtectKernelTunables=true ProtectControlGroups=true MemoryMax=512M diff --git a/docker-compose.yml b/docker-compose.yml index ef1e998..2f2fe5f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/docs/CHART_STANDARDS.md b/docs/CHART_STANDARDS.md index d459d2b..5a75218 100644 --- a/docs/CHART_STANDARDS.md +++ b/docs/CHART_STANDARDS.md @@ -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 @@ -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 ``` @@ -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 @@ -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; diff --git a/docs/DEPLOY_PUBLIC.md b/docs/DEPLOY_PUBLIC.md index 632d37f..5d28e8a 100644 --- a/docs/DEPLOY_PUBLIC.md +++ b/docs/DEPLOY_PUBLIC.md @@ -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 → **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` @@ -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 . @@ -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 @@ -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 <.json ingress: @@ -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 @@ -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" } } @@ -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 diff --git a/docs/SOURCES_WITH_AUTH.md b/docs/SOURCES_WITH_AUTH.md index efeaed0..0bc0109 100644 --- a/docs/SOURCES_WITH_AUTH.md +++ b/docs/SOURCES_WITH_AUTH.md @@ -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.). @@ -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' ``` diff --git a/docs/SOURCE_PRIORITIES.md b/docs/SOURCE_PRIORITIES.md index e965a0d..e1695d4 100644 --- a/docs/SOURCE_PRIORITIES.md +++ b/docs/SOURCE_PRIORITIES.md @@ -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, diff --git a/docs/source-notes/basedosdados.md b/docs/source-notes/basedosdados.md index 66ab821..663e14e 100644 --- a/docs/source-notes/basedosdados.md +++ b/docs/source-notes/basedosdados.md @@ -4,7 +4,7 @@ Status: supported as a free logged-in source. ## TL;DR — what this really adds -Base dos Dados does **not** replace findata-br's canonical official-source +Base dos Dados does **not** replace openfindata's canonical official-source adapters for BCB, CVM, IBGE, Tesouro, B3, ANBIMA or Receita. For series we already expose directly, such as Selic, FX, IPCA, PIB, CVM funds or Receita arrecadação, treat Base dos Dados as a convenience/fallback/join layer. @@ -12,7 +12,7 @@ arrecadação, treat Base dos Dados as a convenience/fallback/join layer. The real addition is access to a broad, BigQuery-native analytical layer: 1. **Large-table joins without local downloads** across public datasets. -2. **Microdata and treated datasets** that are not yet native findata-br +2. **Microdata and treated datasets** that are not yet native openfindata sources, especially banking, rural credit, labor, fiscal spending, trade, company ownership and regional socioeconomic context. 3. **Fast exploration before implementation**: use SQL to validate whether a @@ -28,7 +28,7 @@ High-value incremental areas are `estban`, `agencia`, `sicor`, Decision rule: keep official adapters canonical; use Base dos Dados when the value is joins, microdata scale, treated tables, or coverage not yet present in -findata-br. +openfindata. Consulta em 2026-04-30 via: @@ -67,7 +67,7 @@ The public catalog currently returns: surface for the dataset. SQL/Python/R access still goes through BigQuery unless a download URL is resolved separately. -## High-priority datasets for findata-br +## High-priority datasets for openfindata These are the datasets most relevant to economics, finance, financial markets, and investment analysis. Prefer them before broad catalogue mirroring. @@ -148,7 +148,7 @@ publishes tables: 1. Do not mirror all 272 economics datasets into the core API. 2. Add thin curated helpers only when they materially complement official - sources already in findata-br. + sources already in openfindata. 3. Prefer BigQuery SQL templates and documented examples for exploratory work. 4. Keep expensive microdata scans out of tests. Unit tests must mock network and must not hit BigQuery. diff --git a/pyproject.toml b/pyproject.toml index 68bb753..7c47c40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "findata-br" +name = "openfindata" version = "0.3.1" description = "Infraestrutura open source para dados financeiros públicos do Brasil via API REST, MCP, CLI e Python" readme = "README.md" @@ -62,10 +62,10 @@ dev = [ findata = "findata.cli:app" [project.urls] -Homepage = "https://github.com/robertoecf/findata-br" -Repository = "https://github.com/robertoecf/findata-br" -Issues = "https://github.com/robertoecf/findata-br/issues" -Documentation = "https://github.com/robertoecf/findata-br#readme" +Homepage = "https://github.com/robertoecf/openfindata" +Repository = "https://github.com/robertoecf/openfindata" +Issues = "https://github.com/robertoecf/openfindata/issues" +Documentation = "https://github.com/robertoecf/openfindata#readme" [tool.hatch.build.targets.wheel] # `packages` already captures the web/static and web/templates assets that diff --git a/scripts/benchmark_public_surface.py b/scripts/benchmark_public_surface.py index 4ee8082..e68bd18 100755 --- a/scripts/benchmark_public_surface.py +++ b/scripts/benchmark_public_surface.py @@ -28,7 +28,7 @@ from typing import Any DEFAULT_BASE_URL = "https://www.dadosdemercado.com.br" -USER_AGENT = "findata-br-public-benchmark/0.2 (+https://github.com/robertoecf/findata-br)" +USER_AGENT = "openfindata-public-benchmark/0.2 (+https://github.com/robertoecf/openfindata)" HTTP_OK = 200 DEFAULT_API_MAX_BYTES = 256 * 1024 MAX_JSON_SHAPE_DEPTH = 3 diff --git a/src/findata/api/app.py b/src/findata/api/app.py index f14fbdf..a570afe 100644 --- a/src/findata/api/app.py +++ b/src/findata/api/app.py @@ -42,7 +42,7 @@ _STARTED_AT = time.time() _PROJECT_NAME = "Dados Financeiros Abertos" -_PROJECT_SLUG = "findata-br" +_PROJECT_SLUG = "openfindata" _PROJECT_STATEMENT = "Infraestrutura open source para dados financeiros públicos do Brasil." diff --git a/src/findata/api/routers/b3.py b/src/findata/api/routers/b3.py index be062a3..41d0ffc 100644 --- a/src/findata/api/routers/b3.py +++ b/src/findata/api/routers/b3.py @@ -26,7 +26,7 @@ def _quotes() -> Any: except ImportError as exc: # pragma: no cover — triggered only without yfinance raise HTTPException( status_code=503, - detail=("B3 support is disabled. Install with: pip install 'findata-br[b3]'"), + detail=("B3 support is disabled. Install with: pip install 'openfindata[b3]'"), ) from exc return quotes diff --git a/src/findata/http_client.py b/src/findata/http_client.py index f034a08..96ecbe5 100644 --- a/src/findata/http_client.py +++ b/src/findata/http_client.py @@ -19,7 +19,7 @@ MAX_CACHE_SIZE = 2048 CACHE_TTL = 900 # 15 min default -USER_AGENT = "findata-br/0.3.1 (+https://github.com/robertoecf/findata-br)" +USER_AGENT = "openfindata/0.3.1 (+https://github.com/robertoecf/openfindata)" _cache: OrderedDict[str, tuple[float, float, Any]] = OrderedDict() # key → (ts, ttl, data) _locks: weakref.WeakValueDictionary[tuple[int | None, str], asyncio.Lock] = ( diff --git a/src/findata/sources/b3/quotes.py b/src/findata/sources/b3/quotes.py index a230692..c031b49 100644 --- a/src/findata/sources/b3/quotes.py +++ b/src/findata/sources/b3/quotes.py @@ -4,7 +4,7 @@ No API key required. Brazilian tickers use .SA suffix. Note: yfinance is sync-only, so we run it in a thread executor. -Import this only if yfinance is installed (pip install findata-br[b3]). +Import this only if yfinance is installed (pip install openfindata[b3]). """ from __future__ import annotations @@ -72,7 +72,7 @@ def _import_yfinance() -> Any: import yfinance as yf except ImportError as exc: raise RuntimeError( - "B3 support requires yfinance. Install with: pip install 'findata-br[b3]'" + "B3 support requires yfinance. Install with: pip install 'openfindata[b3]'" ) from exc return yf diff --git a/src/findata/sources/basedosdados/catalog.py b/src/findata/sources/basedosdados/catalog.py index 9417bc6..c2de4d7 100644 --- a/src/findata/sources/basedosdados/catalog.py +++ b/src/findata/sources/basedosdados/catalog.py @@ -62,7 +62,7 @@ class BaseDosDadosSDKNotInstalledError(RuntimeError): access="free_logged_in", description="Free Python access through the optional basedosdados SDK.", requires=[ - "pip install findata-br[basedosdados]", + "pip install openfindata[basedosdados]", "Google/BigQuery auth for queries", ], ), @@ -111,7 +111,7 @@ def _load_sdk() -> Any: return importlib.import_module("basedosdados") except ModuleNotFoundError as exc: raise BaseDosDadosSDKNotInstalledError( - "Install the optional SDK with: pip install 'findata-br[basedosdados]'" + "Install the optional SDK with: pip install 'openfindata[basedosdados]'" ) from exc diff --git a/src/findata/web/static/chart-explorer.js b/src/findata/web/static/chart-explorer.js index 393c2be..257151e 100644 --- a/src/findata/web/static/chart-explorer.js +++ b/src/findata/web/static/chart-explorer.js @@ -19,7 +19,7 @@ red: "#ef4444", white: "#ffffff", }; - const PRIMARY_SOURCE = "Dados Financeiros Abertos (findata-br)"; + const PRIMARY_SOURCE = "Dados Financeiros Abertos (openfindata)"; const CHART_SCRIPT = "src/findata/web/static/chart-explorer.js"; const CHART_RENDERER = "TradingView Lightweight Charts 5.2.0"; const MAX_POINTS = 5000; @@ -207,7 +207,7 @@ const subsetSource = preset.series ? preset.series.map((series) => series.source).join("; ") : preset.source; - nodes.sourceNote.innerHTML = `Fontes dos dados. Fonte primária/curadoria: ${PRIMARY_SOURCE}. Subsets originais: ${subsetSource}.`; + nodes.sourceNote.innerHTML = `Fontes dos dados. Fonte primária/curadoria: ${PRIMARY_SOURCE}. Subsets originais: ${subsetSource}.`; } }; @@ -239,7 +239,7 @@ : `/${trimmed}`; const url = new URL(rawEndpoint, window.location.origin); if (url.origin !== window.location.origin) { - throw new Error("Use endpoints do próprio findata-br para evitar CORS e fontes opacas."); + throw new Error("Use endpoints do próprio openfindata para evitar CORS e fontes opacas."); } const endpoint = `${url.pathname}${url.search}`; assertAllowedEndpoint(endpoint); @@ -537,7 +537,7 @@ if (nodes.extracted) nodes.extracted.textContent = extractionTimestamp(); if (nodes.cutoff) nodes.cutoff.textContent = `${first} → ${last}`; if (nodes.sourceNote) { - nodes.sourceNote.innerHTML = `Fontes dos dados. Fonte primária/curadoria: ${PRIMARY_SOURCE}. Subsets originais: ${sourceList(options)}.`; + nodes.sourceNote.innerHTML = `Fontes dos dados. Fonte primária/curadoria: ${PRIMARY_SOURCE}. Subsets originais: ${sourceList(options)}.`; } const links = []; items.forEach((item, index) => { @@ -569,7 +569,7 @@ const usesPresetEndpoint = endpoint === presetEndpoint; const options = usesPresetEndpoint ? { ...preset, endpoint: presetEndpoint, field: field || preset.field || "" } - : { endpoint, field, title: endpoint, source: "Endpoint findata-br", frequency: "não inferida" }; + : { endpoint, field, title: endpoint, source: "Endpoint openfindata", frequency: "não inferida" }; if (options.series) { await loadComparison(options); return; @@ -583,13 +583,13 @@ const first = normalized.data[0]?.time; const last = normalized.data[normalized.data.length - 1]?.time; nodes.title.textContent = options.title || endpoint; - nodes.source.textContent = options.source || "Endpoint findata-br"; + nodes.source.textContent = options.source || "Endpoint openfindata"; if (nodes.extracted) { nodes.extracted.textContent = extractionTimestamp(); } if (nodes.cutoff) nodes.cutoff.textContent = `${first} → ${last}`; if (nodes.sourceNote) { - nodes.sourceNote.innerHTML = `Fontes dos dados. Fonte primária/curadoria: ${PRIMARY_SOURCE}. Subsets originais: ${options.source || "endpoint findata-br"}.`; + nodes.sourceNote.innerHTML = `Fontes dos dados. Fonte primária/curadoria: ${PRIMARY_SOURCE}. Subsets originais: ${options.source || "endpoint openfindata"}.`; } const auditUrl = new URL(endpoint, window.location.origin); const auditPath = `${auditUrl.pathname}${auditUrl.search}`; diff --git a/src/findata/web/static/site.js b/src/findata/web/static/site.js index 195aa99..77d544e 100644 --- a/src/findata/web/static/site.js +++ b/src/findata/web/static/site.js @@ -85,7 +85,7 @@ if (!button) return; const original = button.textContent; button.addEventListener("click", async () => { - const value = node.getAttribute("data-copy") || "pip install findata-br"; + const value = node.getAttribute("data-copy") || "pip install openfindata"; await navigator.clipboard?.writeText(value); button.textContent = document.documentElement.lang === "pt-BR" ? "copiado" : "Copied"; window.setTimeout(() => { diff --git a/src/findata/web/templates/charts.html b/src/findata/web/templates/charts.html index 3b36317..9f98de0 100644 --- a/src/findata/web/templates/charts.html +++ b/src/findata/web/templates/charts.html @@ -6,7 +6,7 @@ Dados Financeiros Abertos — labs de gráficos @@ -24,11 +24,11 @@ @@ -39,7 +39,7 @@

Labs experimental · REST → JSON → canvas

Visualizador beta de séries públicas.

- Este experimento mostra como a infraestrutura do findata-br pode virar gráficos + Este experimento mostra como a infraestrutura do openfindata pode virar gráficos auditáveis. O produto principal continua sendo API, biblioteca Python, CLI e MCP; aqui só endpoints temporais e leves entram no canvas.

@@ -90,7 +90,7 @@

Taxa Selic

Fonte primária - Dados Financeiros Abertos (findata-br) + Dados Financeiros Abertos (openfindata)
Extração @@ -104,11 +104,11 @@

Taxa Selic

Fontes dos dados. Fonte primária/curadoria: - Dados Financeiros Abertos (findata-br). + Dados Financeiros Abertos (openfindata). Subsets originais: BCB SGS 432.

@@ -139,7 +139,7 @@

Raw developer tools<