Intuitive Data Workflows
Latest release: xbbg==1.4.12 (release: notes)
This
mainbranch is the Rust-powered v1 release. For the legacy pure-Python line, userelease/0.x.
Important: xbbg is an independent open-source project. It is not affiliated with, endorsed by, sponsored by, or approved by Bloomberg Finance L.P. or its affiliates. Bloomberg, Bloomberg Terminal, B-PIPE, BQL, and related names are trademarks or service marks of their respective owners. xbbg does not grant access to Bloomberg services, data, software, licenses, credentials, or entitlements; users must obtain and use those separately under their own Bloomberg agreements and applicable policies.
xbbg is a Bloomberg client with Python as the primary surface and companion JavaScript/Node bindings, all backed by a shared Rust engine for request execution, response parsing, Arrow-shaped data movement, async workers, typed errors, and diagnostics.
Use xbbg when you already have Bloomberg access and want higher-level helpers for common request patterns, plus an escape hatch for lower-level Bloomberg service requests.
Core scope:
js-xbbgxbbg's project goal is direct: be the most complete, technically advanced, and performance-focused open-source Bloomberg client for Python workflows, while staying independent of Bloomberg and requiring users to bring their own authorized Bloomberg access.
The short version: if all you need is a tiny one-off bdp() wrapper, several packages can work. xbbg is built for the path where that notebook later grows into intraday data, BQL, streaming, B-PIPE/SAPI, ZFP, async services, typed errors, diagnostics, and non-pandas data pipelines.
| Capability | xbbg | raw blpapi |
pdblp / blp | bbg-fetch | polars-bloomberg |
|---|---|---|---|---|---|
| BDP/BDS/BDH helpers | yes | manual SDK code | yes | yes | partial |
| Intraday bars and ticks | yes | manual SDK code | limited / no | no | partial |
| Streaming subscriptions | yes | manual SDK code | no | no | no |
| BQL, BEQS, BSRCH, BQR, YAS, BTA | broad helper coverage | manual SDK code | limited | limited | partial |
| DAPI, SAPI/B-PIPE, ZFP, TLS, failover, SOCKS5 | configurable engine support | manual SDK code | limited | limited | limited |
| Async worker pools and isolated subscription sessions | yes | application-owned | no | no | no |
| Rust request/parsing engine with Arrow-shaped output | yes | no | no | no | no |
| Output backends beyond pandas | Narwhals, native, PyArrow, pandas, Polars, DuckDB | application-owned | pandas-first | pandas-first | Polars-first |
| Typed errors, diagnostics, field cache, testing helpers | yes | application-owned | limited | limited | limited |
| Usable install footprint (Windows x64, Python 3.14) | xbbg 1.4.12 + narwhals 2.26.0, no blpapi = 18.245 MiB |
blpapi 3.26.8.1 = 14.702 MiB | pdblp 0.1.8 + pandas 3.0.5 + numpy 2.5.3 + blpapi 3.26.8.1 = 130.816 MiB / blp 0.0.4 + pandas 3.0.5 + numpy 2.5.3 + blpapi 3.26.8.1 = 131.002 MiB | bbg-fetch 3.2.0 + pandas 3.0.5 + numpy 2.5.3 + blpapi 3.26.8.1 = 130.863 MiB | polars-bloomberg 0.6.0 + polars 1.44.2 + blpapi 3.26.8.1 = 191.118 MiB |
pip install xbbgConda users can install the conda-forge build:
conda install -c conda-forge xbbgblpapi is not required as a Python dependency. xbbg only needs Bloomberg's shared runtime library
(blpapi3_64.dll on Windows, libblpapi3_64.so on macOS/Linux), which can come from Bloomberg
Terminal/DAPI, a managed Bloomberg C++ SDK install, or Bloomberg's official blpapi wheel. Installing
the wheel is just the easiest discovery path for many users:
pip install blpapi --index-url=https://blpapi.bloomberg.com/repository/releases/python/simple/Supported Python versions: 3.10 through 3.14.
Requirements and notes:
bash ./scripts/sdktool.sh on macOS/Linux or .\\scripts\\sdktool.ps1 on Windows PowerShell.BLPAPI_ROOT or use xbbg.set_sdk_path(...).C:\blp\DAPI and C:\Program Files (x86)\Bloomberg\Blp\DAPI before requiring manual configuration.manylinux_2_28 (x86_64): any distro with glibc ≥ 2.28 works — RHEL/Alma/Rocky 8+, Debian 10+, Ubuntu 20.04+, Amazon Linux 2023.xbbg[pyarrow], xbbg[pandas], xbbg[polars], or xbbg[duckdb].Verify the install:
import xbbg
print(xbbg.__version__)
print(xbbg.get_sdk_info())from xbbg import blp
# Reference data
prices = blp.bdp(["AAPL US Equity", "MSFT US Equity"], "PX_LAST")
# Historical data
hist = blp.bdh("SPX Index", "PX_LAST", "2024-01-01", "2024-12-31")
# Intraday bars
bars = blp.bdib("TSLA US Equity", dt="2024-01-15", interval=5)Common request patterns:
…ETF NAV / iNAV workflows live in xbbg.ext and resolve Bloomberg's authoritative
ETF_NAV_TICKER / ETF_INAV_TICKER relationships instead of guessing ticker suffixes:
…For longer walkthroughs and example output shapes, use the examples notebook or xbbg.org.
xbbg also ships supported Node bindings in @xbbg/core. The JS layer uses the same Rust engine through a native N-API addon, so Node can use the same Bloomberg connection modes and request surfaces as Python.
npm install @xbbg/core
# or
bun add @xbbg/coreThe packages target Node.js 24+ server runtimes. Packaged native addons are provided for macOS arm64, Linux x64 (glibc 2.28+), and Windows x64. You still need Bloomberg access plus Bloomberg SDK runtime libraries on the target system.
import * as xbbg from '@xbbg/core';
xbbg.configure({ host: 'localhost', port: 8194 });
const hist = await xbbg.blp.abdh(['AAPL US Equity'], ['PX_LAST'], '2024-01-01', '2024-12-31');
const ref = await xbbg.blp.abdp(['AAPL US Equity'], ['PX_LAST', 'SECURITY_NAME']);See js-xbbg/README.md for platform packaging, runtime prerequisites, and the supported JavaScript API surface.
For LangChain and LangGraph agents, use the supported @xbbg/langgraph adapter. It exposes reusable server-side Bloomberg tools backed by @xbbg/core without making MCP, a chat app, or a browser integration the core path:
npm install @xbbg/langgraph @xbbg/core @langchain/coreimport { createAllBloombergTools, BLOOMBERG_TOOL_INSTRUCTIONS } from '@xbbg/langgraph';
const tools = createAllBloombergTools({ maxSecurities: 10, maxFields: 10 });Use the existing apps/xbbg-mcp package only when you specifically need MCP.
By default, xbbg starts a Rust-backed engine and connects to local Bloomberg Desktop API / DAPI on localhost:8194. Configure the engine before the first request when you need a different transport, authentication mode, worker count, timeout policy, field cache, or logging behavior.
from xbbg import blp, configure
# Equivalent to the default local Terminal / DAPI path
configure(host="localhost", port=8194)
print(blp.bdp("AAPL US Equity", "PX_LAST"))Common environments:
| Environment | Use when | Configuration shape |
|---|---|---|
| Desktop API / DAPI | Local Bloomberg Terminal session | no config, or configure(host="localhost", port=8194) |
| Direct server / SAPI | Firm-managed Bloomberg server | configure(host="bpipe-host", port=8194, auth_method="app", app_name="...") |
| B-PIPE | Enterprise Bloomberg feed infrastructure | direct host/failover config plus the auth/TLS settings your Bloomberg setup requires |
| ZFP leased line | Bloomberg zero-footprint leased-line path | configure(zfp_remote="8194", tls_client_credentials="...", tls_trust_material="...") |
Example B-PIPE/SAPI-style configuration:
from xbbg import configure
configure(
host="bpipe-host",
port=8194,
auth_method="app",
app_name="my-app",
request_pool_size=4,
# Opt-in sharding for wide multi-security BDP/BDH requests:
# shard_requests=True,
# shard_threshold=20,
# shard_chunk_size=16,
# shard_max_concurrent=4,
subscription_pool_size=2,
num_start_attempts=5,
)Example ZFP leased-line configuration:
from xbbg import configure
configure(
zfp_remote="8194",
tls_client_credentials="/path/to/client.p12",
tls_client_credentials_password="",
tls_trust_material="/path/to/trust.pem",
)The engine uses separate worker pools for request/response calls and subscriptions:
runtime_worker_threads defaults to 2 (minimum 1) and controls the engine's shared Tokio runtime, not the total process thread count. subscription_pool_size is the pre-warm count (default 1, minimum 0); max_subscription_sessions caps concurrent subscription sessions (default 32, minimum 1, and at least subscription_pool_size). Native subscription admission waits for capacity instead of allocating unbounded sessions. Node uses the corresponding runtimeWorkerThreads, subscriptionPoolSize, and maxSubscriptionSessions fields.
Use Engine(...) when an application needs a scoped engine with its own connection settings instead of mutating global configuration.
Engine shutdown closes subscription admission and signals both idle and checked-out sessions, waking pending operations so termination and errors can reach callers. Close subscriptions explicitly before releasing their engine; do not rely on interpreter teardown for application cleanup.
Field-cache snapshots are published atomically. On Windows this uses FileRenameInfoEx with POSIX rename semantics, requiring Windows 10 1607+ and a supporting filesystem. Existing readers can finish with the old snapshot while new opens see the complete replacement. Unsupported filesystems report persistence errors and retain the prior snapshot; there is no unsafe repla
No open issues yet, or sync has not completed.