Commit Graph

443 Commits

Author SHA1 Message Date
Danglewood
035982860c bump core version (#7682) 2026-09-26 00:36:07 -07:00
Danglewood
79622143c5 deincrement openbb-core version to allow release pattern 2026-09-26 00:21:14 -07:00
Danglewood
45feafe11a actually fix python 3.10 test failure in core 2026-09-25 22:42:08 -07:00
Danglewood
4d5017ad4d fix python 3.10 test failure in core 2026-09-25 22:34:57 -07:00
Danglewood
f0258c9336 fix publish workflows with missing tag job, some tests and bump fastapi 2026-09-25 22:25:53 -07:00
Danglewood
d377ba941e test publish pipeline with openbb-core-v2.0.0rc0 (#7681) 2026-09-25 19:51:50 -07:00
Danglewood
932a895a06 fix cli renderer helper with figure object JSON 2026-09-25 10:58:33 -07:00
Danglewood
1fa72f80d7 test coverage 2026-09-25 09:44:33 -07:00
Danglewood
aba09afb1c fixes for docstring generation 2026-09-24 22:21:39 -07:00
Danglewood
b48accbdd4 [V5] openbb-mcp-server: Refactor for v5 - Spec, Config, Packaging, Test Coverage (#7495)
* stash some changes

* add more robust testing

* mypy

* point PR at V5

* introduce spec file

* codespell

* test fix

* fix workflow environment setup

* fix workflow environment setup

* fix workflow environment setup

* add pyyaml to dependencies

* split lint jobs

* fix workflow environment setup

* fix workflow environment setup

* workflow env setup

* workflow env setup

* clean up code comments

* add auth hook entrypoints

* codespell

* add codegen feature

* codespell

* move _unpack into dispatchers for consistency with codegen packages

* surface nested models in the response

* fix missing coverage in CI

* socrata updates

* test fix

* detect plotly output

* add --include and --exclude flags from generate-extension command

* refactor mcp server for v5

* test action

* fix tests

* tests

* test fixture name

* revert: drop unrelated provider/README changes from mcp-server refactor

Strip the changes to ``README.md`` and ``openbb_platform/providers/{imf,
tradingeconomics,yfinance}`` that snuck into 4ac3602 (refactor mcp server
for v5). Those files are out of scope for the mcp-server work and were
modified inadvertently — restore them to their pre-4ac3602 state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* tests and workflows

* fix workflow

* tests and workflows

* tests and workflows

* tests and workflows

* tests and workflows

* beartype shim for 3.15

* muck around with beartype for 3.15

* muck around with beartype for 3.15

* no 3.15 runners for mcp-server

* update skill files

* cap test matrix at python 3.14

* merge branch v5

* no useless comments

* platform controller command description split

* merge URL overloads from path params

* exclude none and unset from model dump

* refactor for fastmcp4

* wrap markdown lines that are too long

---------

Co-authored-by: deeleeramone <>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-09-24 20:04:13 -07:00
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
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
4fe1bbcb94 fix tag grouping in swagger docs 2026-09-18 19:37:09 -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
90d427c5a5 restore test coverage to 100% in openbb_core 2026-09-14 11:26:28 -07:00
Danglewood
f6867c2b18 [V5] openbb-charting: Refactor for V5 and Decouple (#7545)
* refactor charting for v5 patterns and decouple entirely

* coveragerc

* lint and tests

* fix tests

* configure dev group with openbb-technical

* ty

* fix cli test

* remove 3.15 from test matrix - dependencies are unstable

---------

Co-authored-by: deeleeramone <>
2026-07-01 09:37:01 -07:00
Danglewood
4bcf8441bc add full support for AsyncIterator response type for streaming output (#7530) 2026-06-22 14:35:55 -07:00
Danglewood
6ca062bf86 [V5] openbb-platform-api: Refactor for V5 Spec, Config, Packaging, Test Coverage (#7494)
* stash some changes

* add more robust testing

* mypy

* point PR at V5

* introduce spec file

* codespell

* test fix

* fix workflow environment setup

* fix workflow environment setup

* fix workflow environment setup

* add pyyaml to dependencies

* split lint jobs

* fix workflow environment setup

* fix workflow environment setup

* workflow env setup

* workflow env setup

* clean up code comments

* add auth hook entrypoints

* codespell

* add codegen feature

* codespell

* move _unpack into dispatchers for consistency with codegen packages

* surface nested models in the response

* fix missing coverage in CI

* socrata updates

* test fix

* detect plotly output

* add --include and --exclude flags from generate-extension command

* refactor openbb-platform-api for V5 operations and spec file handling

* delete poetry.lock

* add test workflow

* add temp branch id for test workflow

* add httpx to dev dependencies

* add a conftest.py

* tweak conftest

* tweak conftest

* python 3.10 issues

* more python 3.10

* more python 3.10

* more python 3.10

* more python 3.10

* fix url template resolution

* multi-spec support

* fix a windows path issue

* cap test matrix at python 3.14

* no 3.15 runners for platform-api

* no useless comments

* platform controller command description split

* merge URL overloads from path params

* exclude none and unset from model dump

* markdown lint

* ignore get/post endpoints that are return SSE

* fix remaining fastapi 0.137 fallout

---------

Co-authored-by: deeleeramone <>
Co-authored-by: Copilot <copilot@github.com>
2026-06-20 20:23:23 -07:00
Danglewood
d8bab38d57 [V5] [BugFix] Fix for Breaking Changes in FastAPI 0.137+ (#7537)
* fix route introspection for fastapi 0.137

* recapture oeccd gdp forecast test cassette

---------

Co-authored-by: deeleeramone <>
2026-06-18 08:35:41 -07:00
Danglewood
d8fd8f06da some ty items and add requests-types stubs for ty in devtools 2026-06-01 14:24:13 -07:00
Danglewood
aa2b9a8d36 [V5] remove wsj provider and related code (#7485)
* remove wsj provider and related code

* purge from metadata
2026-05-29 10:50:04 +03:00
Danglewood
49cd447674 merge branch develop 2026-05-25 22:43:18 -07:00
Danglewood
caf49e818c FieldInfo import 2026-05-25 22:35:39 -07:00
Danglewood
3735afca3f backport OptionsChainsData serialize schema fix from v5 branch (#7511) 2026-05-26 05:33:14 +00:00
Danglewood
38d636a7a6 linter 2026-05-25 22:31:55 -07:00
Danglewood
976a4fd098 fix test drift 2026-05-25 22:26:21 -07:00
Danglewood
074842ed4f merge branch develop 2026-05-25 22:18:01 -07:00
Danglewood
89023948ee [BugFix] Remove Bad Validator & Make Fields Optional in FuturesHistoricalData (#7510)
* remove bad validator from futures_historical data model

* ohlv should be optional fields

* black
2026-05-26 05:11:24 +00:00
Danglewood
f56a44ec0c bump dependencies 2026-05-25 21:56:17 -07:00
deeleeramone
e79623ceef remove comment chatter 2026-05-16 18:31:21 -07:00
deeleeramone
3a2bfbcbaf unpack POST parameters from params: Model 2026-05-16 17:59:00 -07:00
Danglewood
b455cf240a fix docstring generator and body param unwrapping 2026-05-15 21:57:59 -07:00
Danglewood
186cbb068c [Security] Bump python-multipart Version (#7493)
* bump python-multipart

* cookiecutter lock file
2026-05-11 22:40:28 +00:00
Danglewood
70bbf37caa test_system_settings 2026-05-11 15:36:13 -07:00
Danglewood
a18a292131 ruff UP007 2026-05-11 15:25:41 -07:00
Danglewood
3a978b654c update for deprecated pydantic syntax 2026-05-11 15:22:03 -07:00
Danglewood
ac39b23c9b [V5] openbb-core: Add Backwards-Compatible Layered Config System (openbb.toml) (#7492)
* add backwards-compatible layered config system

* fix path reference in windows test

* need python version-aware handling in docstring generator
2026-05-07 12:37:05 -07:00
Danglewood
f18493c293 missing coverage 2026-05-05 23:55:35 -07:00
Jitendra Chamoli
08c63e4901 fix(core): invoke linters via python -m so PATH state can't silently skip them (#7488)
* fix(core): invoke linters via `python -m` so PATH state can't silently skip them

`Linters.run()` used `shutil.which(linter)` which resolves the binary against
the process `PATH`. When users run `.venv/bin/python` directly — as
`dev_install.py` itself does, and as common IDE configurations do — the venv's
`bin/` directory is not on `PATH`, so `which("ruff")` returned `None` and the
linter step silently no-op'd.

That mattered because `ImportDefinition.build` emits speculative type imports
(e.g. `OBBject_EquityInfo`) by design and relies on `ruff --fix` to strip the
unused ones. Without the cleanup, those imports remained in generated files
and produced `ImportError` on first import — the symptom many users have hit.

This change resolves the linter through `sys.executable -m <linter>` so it
always resolves against the running Python's environment, independent of
`PATH`. A pre-check via `importlib.util.find_spec` preserves the
"linter not found" path for environments where the package genuinely isn't
installed. A second guard skips invocation when the target directory has no
`*.py` files, which prevents the linter from falling back to its default
working-directory scan.

Adds two regression tests:
- `test_ruff_strips_unused_imports_via_module_invocation` simulates the
  failing scenario by clearing `PATH` and asserts ruff still removes an
  unused import.
- `test_run_logs_not_found_when_module_missing` exercises the missing-module
  branch with a known-bogus linter name.

* style(linters): collapse subprocess.run call to satisfy black

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(linters): keep command list[str] to satisfy mypy

Glob produces Path objects; concatenating with the str command list
tripped mypy's "list[str] + list[Path]" check. Stringify the file
paths up-front so the assembled command is uniformly list[str].

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 16:39:12 +00:00
Danglewood
f899588da9 fix docstring generator for nested models 2026-05-03 13:55:01 -07:00
Danglewood
73b0516366 package builder fixes 2026-05-02 22:22:42 -07:00
Danglewood
172131ea5e [V5] openbb-core: 100% Test Coverage (#7484)
* increase test coverage to exercise 100% of the testable code path in openbb-core

* model_fields syntax cleanup

* set the environment variable for CI runs

* run codeql on v5 branch

* more CI env setup

* cleanup redundant files

* ruff

* dedupe workflow trigger

* some windows coverage missing

* ubuntu integration test job

* more windows coverage

* test_reference_generator

* test_docstring_generator

* remove line no references from test function docstrings

* clean useless comments from test files

* fix polars type check

* fix test_obbject

* fix test_obbject
2026-04-30 11:49:41 -07:00
Danglewood
7041362aa1 [Feature] OpenBB V5: Initial openbb-core Refactor (#7482)
* initial refactor

* ruff does not dictate style

* unresolved imports in test action

* fix general linting

* resolve pandas imports for actions run

* httpx in test workflow

* pytest-asyncio in test workflow

* pandas.Index(...)

* max version for windows CI is 3.14

* remove temp refactor files that shouldn't have been committed:

* use ruff format instead of black

* formatting and typing

* tab space helper

* test fixtures..

* ty check
2026-04-28 17:11:43 -07:00
Danglewood
ef0b9cfc80 [Feature] Delete frontend-components (#7436)
* delete frontend-components

* lint

* lint

* lint

* black

* black

* lint

* fix a test

* some touchups

* readme updates

* codespell

* linters

* classVar

* cli pyproject and lock
2026-04-23 00:53:44 +00:00
Danglewood
9eca7b9f23 [Enhancement] openbb-cftc: Improve CFTC Endpoints and Make a Standalone Workspace App For COT Data (#7449)
* improve cftc endpoints and make a standalone workspace app

* mypy

* forgot  couple of files to commit

* test params

* integration test param name

* fix sec-sic-search

* fill some contracts missing category and subcategory, add a workspace workchoices endpoint

* linter

* integration test for cot_choices
2026-04-20 22:36:41 +00:00
Danglewood
207c24a466 [BugFix] Bump python-multipart and Fix yfinance Property (#7476)
* bump python-multipart and fix yfinance property

* remove file that wasn't supposed to be added to commit
2026-04-18 07:30:28 +00:00