Commit Graph

6984 Commits

Author SHA1 Message Date
Dex Hunter
b0c092ece5 perf(core): vectorize the date conversion in basemodel_to_df (#7622)
* perf(core): vectorize the date conversion in basemodel_to_df

basemodel_to_df ran three per-element Python passes over the date column of
every payload it converted. Series.apply(to_datetime) calls pandas.to_datetime
once per row, and because each call receives a lone scalar with no format hint,
pandas also re-runs its datetime format guesser on every row.

Parse the column in one call instead, and use vectorized comparisons for the
all-midnight test and the reduction to datetime.date.

The element-wise parse is kept as a fallback for one case that the vectorized
path cannot represent: a column mixing UTC offsets, such as a series crossing a
daylight-savings boundary. Parsing per element lets each value keep its own
offset and yields an object column of tz-aware Timestamps, whereas a single
to_datetime call over that column raises "Mixed timezones detected". That
behaviour is covered by test_to_df_daylight_savings and is preserved exactly.

Measured on a payload built through EquityHistoricalData, median of 9 under an
exclusive CPU lock:

  250 daily bars     8.92 ms -> 1.46 ms
  1,000 daily bars  32.93 ms -> 3.13 ms
  5,000 daily bars 162.25 ms -> 12.23 ms

* fix a broken test - unrelated to this PR...

---------

Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Co-authored-by: deeleeramone <>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 19:12:59 -07:00
Boris Li
915bfa48f1 Enterprise Flask Migration Toolkit (#7264)
* feat: Add Flask-to-OpenBB enterprise migration toolkit

- Implement Router.from_flask() for zero-touch legacy API conversion
- Enable 4-hour migration vs 6-month traditional rewrite (80% cost reduction)
- Generate FastAPI endpoints from Flask routes with automatic type validation
- Support enterprise consulting services and custom integration workflows

Demonstrates OpenBB's competitive advantage for institutional client migrations.
Complements existing Workspace applications like Open Portfolio suite.

* chore: Resolve .gitignore conflict and add common ignores

* refactor: implement Phase 1 Flask integration architecture- Move Flask conversion logic to openbb_core.app.utils.flask- Add Flask detection to extension_loader - Integrate with OpenBB's core extension system- Add Flask dependency validation with sys.modules checkingAddresses @deeleeramone's architectural feedback for native OpenBB integration.

* docs: add Flask direct entry point demos- demo_direct_flask_entry_point.py: shows direct Flask instance reference- example_pyproject_flask_entry.toml: demonstrates pyproject.toml configurationSupports new architecture eliminating wrapper extensions.

* Implement Phase 1 Flask adapter per code review feedback

- Minimal working implementation with Flask detection and router creation
- Removes complex code generation logic for focused Phase 1 delivery
- Establishes foundation for Phase 2 route conversion features

* Fix Flask integration: Replace missing FlaskToOpenBBAdapter with WSGIMiddleware

- Remove FlaskToOpenBBAdapter which was not implemented
- Use FastAPI's WSGIMiddleware to mount Flask apps directly
- Update extension_loader to use returned Router object
- Convert utils.py to utils/__init__.py to support flask submodule
- Addresses PR review comment about unhandled AttributeError

* Address PR review feedback: fix Flask imports and remove unused files

- Revert .gitignore to upstream/develop
- Remove AI-generated demo/example files and flask_adapter extension
- Move Flask/werkzeug imports inside conditional blocks to avoid ImportError
- Use lazy imports via __getattr__ in utils/flask/__init__.py
- Add Flask tests with @pytest.mark.skipif markers

* Force APIRouter.include_router to propagate Mount paths instead of dropping them. (#1)

This change ensures that mounted ASGI applications (such as Flask apps wrapped in WSGIMiddleware) are not dropped when `APIRouter.include_router` is called.

Previously, while the initial load in `ExtensionLoader` worked as expected, the `Mount` objects were ignored by FastAPI's default inclusion logic. This caused the mounted elements to be lost during the final application assembly, resulting in 404 errors for the Flask routes.

This fix overrides the inclusion logic to manually propagate `Mount` objects downstream.

* feat(flask): Add metadata layer for OpenAPI documentation

Enhance Flask-to-OpenBB converter with structured docstring parsing:
- Parse Google-style docstrings (summary, description, params)
- Extract parameter descriptions from Args section
- Pass metadata to Router.command() for rich OpenAPI docs

This addresses PR feedback to provide tangible benefit by generating
comprehensive API documentation for migrated Flask routes.

* feat(flask): Implement manual OpenAPI spec generation and attachment

- Add FlaskParam and FlaskRouteInfo TypedDict for type-safe metadata
- Implement OpenAPISpecGenerator for Flask→OpenAPI conversion
- Extract route metadata via FlaskIntrospector
- Attach generated spec to router.openbb_openapi_spec_ext
- Add unit tests (3/3 passing)

Addresses WSGI/mount boundary issue where Router.command metadata
cannot propagate through WSGIMiddleware. Spec attached to router
instance for downstream OpenAPI assembly.

Resolves maintainer feedback on PR #7264

* feat(flask): Implement FlaskMountRegistry for multiple mount support

- Add FlaskMountRegistry class for centralized OpenAPI spec management
- Replace router.openbb_openapi_spec_ext with registry pattern
- Support multiple Flask apps at different mount prefixes
- Automatic path rewriting in aggregated OpenAPI specs
- Add registry test case (4/4 tests passing)

Addresses @deeleeramone's feedback on PR #7264 regarding router
attribute fragility and multiple mount support. Registry provides
lifecycle-independent state management and enables enterprise
scenarios with multiple Flask apps.

Resolves: OpenBB-finance/OpenBB#7264 (partial)

* feat(core): load Flask apps as openbb_core_extension WSGI sub-apps

A Flask app referenced directly by an openbb_core_extension entry point is
mounted via WSGIMiddleware and its routes are introspected into openapi.json
(operationId/widgetId/mcp_tool, parameters, request bodies, security, widget_config
and HTML widgets) so the widget factory and MCP server can discover them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test(core): 100% coverage for flask utils + flask dev dependency

Add branch-coverage tests for the Flask integration package (introspection,
AST analysis, docstrings, OpenAPI generation, registry, loader, detection) and
declare flask as a dev dependency so the suite runs in CI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(flask): treat f-string returns as HTML responses

* fix(flask): mount via a2wsgi instead of deprecated starlette WSGIMiddleware

- add openbb-core[flask] extra (flask, a2wsgi); a2wsgi resolved through require_optional
- run the WSGI serve test through mount_flask_extensions; drop httpx importorskip
- core CI installs [pandas,flask] and httpx2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(flask): cover failed entry point loads; narrow optional types for ty

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Co-authored-by: deeleeramone <>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-24 18:19:50 -07:00
Danglewood
1cbb24d8b7 bump devtools and repoint pyproject.toml 2026-09-24 15:07:09 -07:00
Danglewood
8a1b5fd93e [V5] Update Repository License to Apache 2.0 (#7677)
* change license to Apache 2.0 for V5

* codespell
2026-09-24 13:32:17 -07:00
Danglewood
d0090d60dc fix lint errors 2026-09-24 12:40:08 -07:00
Danglewood
337cef5db8 [V5] openbb-finra: Refactor for V5 (#7676)
* refactor finra provider for v5

* add workflows

* fix tests
2026-09-24 09:13:30 -07:00
Danglewood
dc4b26030f [V5] openbb-sec: Refactor for V5 (#7525)
* refactor openbb-sec for v5

* linting

* ty

* normalize compare_company_facts

* add workflows

* python 3.10 fix

* add more thorough url validation and tests

* ty check

* ty for python 3.10

* reconfigure with apps

* temp pyproject overrride

* pyproject

* pyproject

* pyproject

* codespell

* pyproject

* fix uk schema file links in schema_files

* test coverage

* test_cli

* port #7547 into this pr

* no hard coded prefix

* improve filing rendering capabilities

* fix xml text detection

* make codeql happy

* missed a file in the commit

* test coverage

* codespell

* fix flakey test

* some updates

* management_ownership --> management_profiles

* proxy statement markdown

* ruff

* fix test coverage

* more tests

* test coverage

* fix lint errors

* Add SEC adviser search, profile, and universe routes (#7559)

* Add SEC institutional data fetchers

* Add SEC filing index and Form D routes

* Add SEC investment adviser people data

* Expose SEC adviser and institutional routes

* fix(sec): address adviser review feedback

* refactor(sec): narrow adviser support to IAPD search

* feat(sec): add adviser firm and individual searches

* feat(sec): add adviser profile drill-down

* fix: repair pre-commit configuration

* feat(sec): add adviser universe route

* feat(sec): expose complete Form ADV data

---------

Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>

* fix test coverage

---------

Co-authored-by: deeleeramone <>
Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
2026-09-24 08:47:49 -07:00
deeleeramone
b6b472a511 codespell 2026-09-23 14:58:03 -07:00
Danglewood
22c92554a0 remove openbb-econdb provider (#7675) 2026-09-23 13:49:40 -07:00
deeleeramone
2c81a8cbb1 fix markdown lint errors 2026-09-23 13:31:40 -07:00
Danglewood
d6fd646402 [V5] openbb-deribit: Refactor provider for V5 (#7674)
* refactor openbb-deribit for v5

* restructure the optimizer around the published combos data and add integration test suites
2026-09-23 13:02:49 -07:00
Danglewood
d1f71e670c [V5] openbb-cboe: Refactor for V5 + Add Payoff Diagrams (#7617)
* refactor cboe for v5

* use zoneinfo instead

* fix test

* some fixes related to the cache access

* fix a couple of tests

* fix the test coverage
2026-09-23 13:00:39 -07:00
Danglewood
124a420f79 [V5] openbb-fred: Refactor as V5 extension. (#7669)
* refactor fred extension for v5

* fix markdown MD037 lint error in README

* codespell
2026-09-23 12:54:02 -07:00
Danglewood
56d6d58fb7 [V5] openbb-nasdaq: Refactor provider for V5. (#7670)
* refactor nasdaq provider for v5

* add workflows

* ty fix
2026-09-23 12:53:41 -07:00
Danglewood
d820270467 [V5] openbb-tmx: Refactor extension for V5 (#7668)
* refactor tmx provider for v5

* fix tests..

* fix tests stack trace exposure

* fix workflow setup
2026-09-23 12:53:23 -07:00
Danglewood
a2a1456dbc fix for plotly 7 breaking change to schemas 2026-09-23 12:33:44 -07:00
Danglewood
c66935d51e [V5] openbb-cftc: Refactor for V5 + Add OIS, Forward Curve, and FX Trade Analysis (#7615)
* refactor openbb-cftc for v5

* add SHIBOR to fixings

---------

Co-authored-by: deeleeramone <>
2026-09-23 12:08:51 -07:00
Danglewood
b215350687 [V5] Feature: Add JODI World Oil & Gas Database (#7593)
* add the JODI oil and gas database as a provider/router extension

* lint fixes

* add grouping to apps.json

---------

Co-authored-by: deeleeramone <>
2026-09-23 12:05:12 -07:00
Danglewood
1bace8672c [V5] openbb-government-us: Refactor for V5 + Move uscongress (#7604)
* v5 government_us provider

* workflow files

* ty and add xlrd to pyproject

* shrink test cassettes

* dev dependencies

* wheel packaging and more tests

* python 3.10 thing..?

* fix test

* default state for multiselect dropdowns

* replace congress html widgets with iframes

* fallback to congress api for congress before 108

* ensure member passage voting count populates
2026-09-23 12:04:29 -07:00
Danglewood
a2f3a5f16f [V5] openbb-eia: Refactor for V5 + Add Full API Implementation (#7584)
* eia refactor for v5

* add test and publish workflows

* data browser state

* fix workflows

* more workflow test items

* temp files in tests

* more fixes

* more browsers

* fix codeql issues

* fix mer state and ensure multi-user capability

* uv lock

* table bridge

* fix electricity browser state

* convert HTML widgets to iFrame

* fix recursion error in workspace mcp
2026-09-23 12:00:10 -07:00
Danglewood
46981c6f93 [V5] openbb-federal-reserve: Refactor for V5 + FFIEC & Regional Fed Routers (#7561)
* refactor for v5

* add workflows

* fix bhcpr schema

* fix pyproject.toml

* fix test

* codespell

* ty

* fix pyproject

* fix ci environment

* fix ci environment

* convert documents endpoints to use fedinprint service

* codeql fix

* fix ny publications and add ny nowcast
2026-09-23 11:59:25 -07:00
Danglewood
840658d01f [V5] openbb-ecb: Refactor for V5 and Expand Coverage (#7560)
* refactor openbb-ecb for v5 and expand coverage

* some updates

* tests

* workflow

* remove 3.15 from test matrix

* some more table schema updates

* remove some html chrome on embedded articles

---------

Co-authored-by: deeleeramone <>
2026-09-23 11:57:59 -07:00
Danglewood
4fe1bbcb94 fix tag grouping in swagger docs 2026-09-18 19:37:09 -07:00
Danglewood
99e5c8618e fix new ty issues 2026-09-17 14:06:27 -07:00
Danglewood
b59b2b18bd add charting coverage 2026-09-17 11:36:47 -07:00
Danglewood
35ce305fba fix charting conftest and missing coverage in 3.10 2026-09-17 11:22:16 -07:00
Danglewood
34716a17f3 unpin ruff 2026-09-16 19:57:09 -07:00
Danglewood
59c7c7eff4 remove fmp provider extension from repository (#7665) 2026-09-14 13:20:50 -07:00
Danglewood
90d427c5a5 restore test coverage to 100% in openbb_core 2026-09-14 11:26:28 -07:00
Danglewood
21ed5fe367 add httpx2 to devtools for starlette test client 2026-09-14 09:41:25 -07:00
Danglewood
4bda693362 Merge branch 'v5' of https://github.com/OpenBB-finance/OpenBB into v5 2026-09-14 09:27:06 -07:00
Danglewood
46ef4a5f7b remove openbb-multpl from repository (#7610) 2026-09-14 09:21:37 -07:00
Danglewood
70e46b9d7e remove trading economics provider (#7578) 2026-09-14 09:21:09 -07:00
Danglewood
869edd20ee remove finviz (#7577) 2026-09-14 09:20:46 -07:00
Danglewood
67ebf4a465 plotly 7 handling for mapbox namespace change 2026-09-14 09:19:39 -07:00
Danglewood
0aa6039532 missing test coverage that appeared in famafrench.. 2026-07-28 09:39:26 -07:00
Danglewood
0ff1a54706 codespell 2026-07-23 19:43:40 -07:00
Danglewood
9d596f6373 add drugs.com and brutalist as news rss feeds (#7602)
Co-authored-by: deeleeramone <>
2026-07-23 19:41:22 -07:00
Danglewood
a07534cfa4 fix ty check failures exposed by newer version 2026-07-22 11:48:28 -07:00
Monte Hoover
80634fe604 Update class generation code to handle empty data that php-style serialization emits as []. (#7599) 2026-07-20 16:04:55 -07:00
Danglewood
76c327ca75 Merge branch 'develop' into v5 2026-07-20 15:59:31 -07:00
Monte Hoover
8329f7758c Update the record-vs-envelope heuristic in the payload processing code to not treat a record that happens to have a list datatype as an entire envelope. (#7598) 2026-07-20 15:05:24 -07:00
Monte Hoover
5e13e3add4 Update generated tests to get python parameter names instead of raw API-provider parameter names. (#7597) 2026-07-20 11:17:01 -07:00
Sanjay Santhanam
3e071fcc2c fix(mcp): support stdio transport on Windows (#7596)
Windows asyncio event loops do not implement add_signal_handler, causing the stdio server to exit before serving requests. Treat signal registration as optional and cover the unsupported-loop path with a regression test.
2026-07-20 17:45:28 +00:00
Danglewood
56d70f6719 Merge branch 'develop' of https://github.com/OpenBB-finance/OpenBB into v5 2026-07-16 10:30:02 -07:00
Danglewood
ebee248ed0 fix a linting error in the desktop code introduced by a newer version of Clippy - useless_borrows_in_formatting (#7590) 2026-07-16 15:44:01 +00:00
Danglewood
1ad72fd756 unused ty ignore 2026-07-14 13:35:41 -07:00
Danglewood
2fca403750 Merge branch 'develop' of https://github.com/OpenBB-finance/OpenBB into v5 2026-07-14 13:07:40 -07:00
Danglewood
c78488d7d1 [BugFix] openbb-sec: Handle XOM's CIK Transition (#7588)
* add handling for XOM's new CIK and populating results including the legacy

* update a couple of lock files for dependabot
2026-07-14 19:49:56 +00:00
Danglewood
5b20e24352 [V5] openbb-cli: Modular OpenAPI Refs (#7589)
* follow up to #7585

* add another codegen test
2026-07-14 12:49:37 -07:00