Skip to content

Python public surface

xbbg for notebooks, pipelines, and services.

Use familiar Bloomberg-style helpers from Python while transport, sessions, auth, async execution, middleware, and Arrow-native outputs run through the same Rust engine used by @xbbg/core.

Start here

Install

Install from PyPI, provide the Bloomberg C++ SDK runtime, then verify SDK detection with get_sdk_info().

Make requests

Use bdp, bdh, bds, intraday helpers, BQL/search helpers, subscriptions, or fixed-income workflows.

Choose outputs

Return pandas, Polars, PyArrow, DuckDB, or Narwhals depending on the pipeline you already have.

Scale up

Use a-prefixed async helpers, reusable sessions, request middleware, enterprise auth, TLS, ZFP, failover, SOCKS5, and SDK logging.

Why xbbg is different

Many Python Bloomberg-data packages wrap Bloomberg's blpapi Python bindings directly. That can be enough for small scripts, but production workflows still have to decide where session lifecycle, event parsing, concurrency, diagnostics, middleware, enterprise connectivity, and output conversion live.

xbbg puts those concerns behind a native Rust/Arrow engine that integrates with the Bloomberg C/C++ SDK, manages sessions and worker pools, builds typed Arrow output, and exposes enterprise transports such as ZFP over leased lines, B-PIPE/SAPI auth, TLS, failover servers, SOCKS5, SDK logging, validation, request diagnostics, and request middleware.

API families

FamilyHelpersUse when
Reference / historical / bulkbdp, bdh, bds, bdib, bdtick and async variantsCore market-data retrieval
Search and servicesbql, beqs, bsrch, bqr, bflds, generic requestsBloomberg service workflows beyond simple field pulls
Streamingsubscribe, asubscribe, streaming helpersRealtime data with subscription diagnostics
Fixed incomebqr, bcurves, bgovts, yas, corporate_bonds, bond helpersQuotes, curves, government securities, yield/risk analytics, and cashflows
Operationsconfigure, middleware management, logging, backend configurationProduction setup and observability

Enterprise middleware

xbbg includes request middleware for teams that need platform-wide controls around Bloomberg access. Middleware receives request context and environment snapshots, so one shared pipeline can add audit logging, request IDs, metrics, tracing, entitlement checks, policy enforcement, standardized error handling, and compliance hooks without wrapping every individual bdp(), bdh(), bql(), or streaming call.

Compared with other Bloomberg Python wrappers

xbbg is a Python ergonomic layer on top of a Rust engine backed by Bloomberg C/C++ SDK integration, with a matching Node.js surface on the same core. That distinction matters once a workflow grows beyond a single bdp() call.

  • Raw blpapi is official but low-level: every application has to rebuild session startup, service opening, request construction, correlation IDs, event-loop parsing, error mapping, retries, logging, and dataframe conversion. xbbg keeps SDK access underneath while adding typed helpers, generic service requests, structured errors, async execution, and Arrow-native output.
  • bbg-fetch / BloombergFetch is a Python pandas helper package. It targets Python 3.9–3.12, installs NumPy and pandas as hard dependencies, and does not cover intraday bars, ticks, streaming, BQL, BEQS, BSRCH, BQR, BTA, ZFP, B-PIPE/SAPI auth, SDK logging, multi-backend output, typed Arrow transport, async execution, or generic Bloomberg service requests.
  • pdblp is a legacy pandas-era wrapper and is explicitly superseded by blp; it has no modern Requires-Python floor, depends on old pandas-era assumptions, and is not under active development.
  • blp is cleaner than pdblp but still sits in the classic Python/pandas wrapper category (python>=3.6, mandatory pandas). xbbg moves transport and output handling into native Rust execution, reusable worker pools, Arrow output, enterprise transports, and broad blpapi workflow coverage.
  • polars-bloomberg is useful when Polars is the chosen dataframe layer and has partial BQL/search-style coverage. xbbg keeps Polars as one backend while also supporting pandas, PyArrow, DuckDB, Narwhals, BDP/BDS/BDH/BDIB/BDTICK/streaming workflows, enterprise transports, middleware, diagnostics, generic service requests, and Node.js.

Quick example

python
import xbbg

xbbg.configure(host='localhost', port=8194)
prices = xbbg.bdp(
    ['AAPL US Equity', 'MSFT US Equity'],
    ['PX_LAST', 'VOLUME'],
)

Prefer the top-level helpers in these docs (xbbg.bdp(...), xbbg.configure(...)). If you are coming from the repository README, the module-style import remains supported too: from xbbg import blp and blp.bdp(...).

Next steps

Quick Start

Make reference, historical, bulk, async, and fixed-income requests.

API Surface

See every public export from the installed Python package.

Fixed Income

Use curves, government securities, BQR, YAS, corporate bonds, and bond analytics.

xbbg is independent open-source software and is not affiliated with, endorsed by, sponsored by, or approved by Bloomberg Finance L.P.