openbb-core
openbb-core is the runtime layer. By itself it ships no data, no providers, and no commands. It finds the extensions installed in the current Python environment, merges them into one router, generates the typed obb client from that router, and serves the same router as a FastAPI application. Every call returns an OBBject.
The package contains both the openbb_core module and the openbb module that from openbb import obb imports. Most users never install it directly; provider and toolkit packages depend on it.
Installation
pip install openbb-core
Two optional extras are declared. pandas adds pandas, which the data-processing extensions, openbb-news, and openbb-charting require through openbb-core[pandas]. flask adds Flask and a2wsgi.
pip install "openbb-core[pandas]"
The package requires Python >=3.10,<4. Its direct dependencies are fastapi, uvicorn, pydantic 2, websockets, aiohttp, requests, python-multipart, uuid7, importlib-metadata, python-dotenv, ruff, pyjwt, and, on Python 3.10, tomli.
Entry points
Extensions register with the runtime through setuptools entry points. The core reads three groups.
| Group | Target | Result |
|---|---|---|
openbb_core_extension | a Router, FastAPI, or APIRouter instance | Commands mounted under obb.<name> and /api/v1/<name> |
openbb_provider_extension | a Provider instance | A data source selectable with provider="<name>" |
openbb_obbject_extension | an Extension instance | An accessor on every OBBject, or a callback on command output |
A fourth group, openbb_charting_extension, is read by the charting engine rather than by the core; it maps chart views to command routes. The extension types page describes each group and its options.
Each V5 provider package registers both a provider entry point and a router entry point, which is how obb.fred, obb.sec, and the other provider namespaces come to exist.
Building the Python client
The obb object is generated code. After installing, upgrading, or removing an extension, regenerate it:
openbb-build
The command imports openbb in a subprocess, which rebuilds the static package when it is missing or stale, and calls openbb.build() directly if the import did not rebuild. Importing openbb also rebuilds on its own when it detects that extensions were added or removed since the last build; set OPENBB_AUTO_BUILD=false to turn that off, for example in a container image where the build ran at install time.
Serving the REST API
The router that backs from openbb import obb is also a FastAPI application at openbb_core.api.rest_api:app, so any ASGI server can run it:
uvicorn openbb_core.api.rest_api:app --reload
The interactive OpenAPI documentation is served at /docs. For Workspace integration, widgets, and launcher options, use openbb-api, which wraps this application.
Classes for extension authors
Extension packages build on a small set of public classes.
| Class | Import path | Role |
|---|---|---|
Router | openbb_core.app.router | Declares commands with @router.command(...) |
Provider | openbb_core.provider.abstract.provider | Describes a data source, its credentials, and its fetchers |
Fetcher | openbb_core.provider.abstract.fetcher | Implements transform_query, extract_data or aextract_data, and transform_data |
QueryParams | openbb_core.provider.abstract.query_params | Base Pydantic model for command parameters |
Data | openbb_core.provider.abstract.data | Base Pydantic model for returned rows |
OBBject | openbb_core.app.model.obbject | The response envelope |
Extension | openbb_core.app.model.extension | Registers an OBBject accessor or command-output callback |
A provider's credentials are named <provider>_<credential>: a Provider(name="fred", credentials=["api_key"]) produces the credential fred_api_key.
See the architecture page for how a call flows through these pieces, and the extension types section to start building.