Title: refactor: dedup B3 quote guard and push anbima emissor into the source by robertoecf · Pull Request #31 · robertoecf/OpenFinData · GitHub
Open Graph Title: refactor: dedup B3 quote guard and push anbima emissor into the source by robertoecf · Pull Request #31 · robertoecf/OpenFinData
X Title: refactor: dedup B3 quote guard and push anbima emissor into the source by robertoecf · Pull Request #31 · robertoecf/OpenFinData
Description: What Two contained cleanups from the review of #29 (items 2 and 3 of #30): Share the B3 live-quote guard. New api/_b3_common.py exposes resolve_quotes() and MAX_TICKERS. routers/b3.py and mcp_app.py both resolve the lazy yfinance import through it, so the guard and the pip install 'openfindata[b3]' hint live in one place instead of two near-copies. Push the debenture emissor filter into the source. anbima.get_debentures(...) now takes emissor, and both the REST router and the MCP tool drop their hand-rolled filter loop and pass it through, matching every other source-level filter (FCA ticker, IPE categoria, FIP quarter). Net -23 lines, no behaviour change. ruff format / ruff check / mypy --strict / pytest -m "not integration" (252) green. Item 1 of #30 deliberately left out The third item (push limit into ~18 source functions) is not included here. The unbounded-output bug that motivated it was already fixed in #29 (the MCP tools apply [:limit]). What remains is purely moving the slice into the source functions, which (a) gives no perf win (the CSV/zip is parsed in full regardless), (b) does not unify the REST routers, which need skip+limit via _page, and (c) adds a limit param to 18 public source functions for marginal DRY. Recommend closing #30 with items 2-3, or splitting item 1 into its own ticket if still wanted. Summary by CodeRabbit New Features Added support for filtering debenture results by issuer name. Unified B3 quote handling so single, multiple, and historical quote requests share the same backend selection logic. Bug Fixes Improved error messages when optional B3 quote support is unavailable, including setup guidance. Enforced a consistent maximum number of tickers per request across quote endpoints.
Open Graph Description: What Two contained cleanups from the review of #29 (items 2 and 3 of #30): Share the B3 live-quote guard. New api/_b3_common.py exposes resolve_quotes() and MAX_TICKERS. routers/b3.py and mcp_app....
X Description: What Two contained cleanups from the review of #29 (items 2 and 3 of #30): Share the B3 live-quote guard. New api/_b3_common.py exposes resolve_quotes() and MAX_TICKERS. routers/b3.py and mcp_app....
Opengraph URL: https://github.com/robertoecf/OpenFinData/pull/31
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f248bcac-017a-f211-3fc3-d1a384d769bf |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | ECF4:10DE3:695E0A:964587:6A4BCEEB |
| html-safe-nonce | dda5848a5c8256be30204afbee6dea1144ced9ffe5f87cb6debaadaffa646162 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0Y0OjEwREUzOjY5NUUwQTo5NjQ1ODc6NkE0QkNFRUIiLCJ2aXNpdG9yX2lkIjoiMTUxMzAzOTExNjcwMjA0Mzg4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4f5acdb1b22fd584872c4a7b303ab5fe713690c5d4d5ffa083eea8c9ce71d91f |
| hovercard-subject-tag | pull_request:3946352653 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/robertoecf/OpenFinData/pull/31/files |
| twitter:image | https://avatars.githubusercontent.com/u/54923863?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/54923863?s=400&v=4 |
| og:image:alt | What Two contained cleanups from the review of #29 (items 2 and 3 of #30): Share the B3 live-quote guard. New api/_b3_common.py exposes resolve_quotes() and MAX_TICKERS. routers/b3.py and mcp_app.... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9df996be9551ac02247d09a2f7f64ece66c35ca28885d346e98fdfda9cdaa37b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/robertoecf/OpenFinData git https://github.com/robertoecf/OpenFinData.git |
| octolytics-dimension-user_id | 54923863 |
| octolytics-dimension-user_login | robertoecf |
| octolytics-dimension-repository_id | 1214516543 |
| octolytics-dimension-repository_nwo | robertoecf/OpenFinData |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1214516543 |
| octolytics-dimension-repository_network_root_nwo | robertoecf/OpenFinData |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b71208a1c9ec7ccf364087569d0551f665dda674 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width