Python
CPython 3.11 through 3.15. Wheels are published for Windows x64, Linux x86_64 (glibc 2.28 or newer), and macOS.
Installation
xbbg and connect it to Bloomberg.The package ships the Python API and the native engine; your environment supplies Bloomberg connectivity, the Bloomberg runtime library, and entitlements.
CPython 3.11 through 3.15. Wheels are published for Windows x64, Linux x86_64 (glibc 2.28 or newer), and macOS.
A Bloomberg Terminal (Desktop API), Server API, B-PIPE, or ZFP leased line, with the entitlements for the data you request.
blpapi3_64.dll or libblpapi3_64.so, from Bloomberg's blpapi wheel, a Terminal install, or a Bloomberg C++ SDK.
Linux wheels are manylinux_2_28: RHEL/Alma/Rocky 8+, Debian 10+, Ubuntu 20.04+, and Amazon Linux 2023 work. ZFP leased lines also need Bloomberg-issued TLS credentials; see ZFP over Leased Lines.
Since 1.8.0, releases also include free-threaded CPython wheels (cp314t, cp315t) for Linux x86_64, Windows x64, and macOS arm64, marked beta. PyArrow, pandas, and Narwhals output work there; the Polars and DuckDB backends and xbbg-langgraph do not, because they or their dependencies publish no free-threaded wheels. The package no longer declares an upper Python bound, so newer interpreters resolve to the current release (building from source when no wheel exists); the supported versions are unchanged.
pip install xbbgor from conda-forge:
conda install -c conda-forge xbbgThe only required dependency is narwhals. Install the dataframe libraries you want as extras:
pip install "xbbg[pyarrow]" # pyarrow.Table output (recommended)
pip install "xbbg[pandas]" # pandas DataFrames
pip install "xbbg[polars]" # Polars DataFrames and LazyFrames
pip install "xbbg[duckdb]" # DuckDB relationsPackage page: PyPI / xbbg
xbbg does not need Bloomberg's Python package as such — only the runtime library it ships. When the native extension first loads (on the first request or first engine use since 1.8.0, at import xbbg before that), xbbg looks in this order and uses the first source found; discovery locates the blpapi package without importing it:
xbbg.set_sdk_path()blpapi Python packageBLPAPI_ROOT environment variablepip install blpapi --index-url https://blpapi.bloomberg.com/repository/releases/python/simple/On a machine with a Terminal, xbbg probes the standard DAPI locations automatically:
%SystemDrive%\blp\DAPI, Bloomberg\Blp\DAPI under %ProgramFiles% and %ProgramFiles(x86)%, and Bloomberg\DAPI or Bloomberg\Blp\DAPI under %LOCALAPPDATA%~/blp/DAPI and /opt/bloomberg/DAPIPoint BLPAPI_ROOT at an extracted Bloomberg C++ SDK:
export BLPAPI_ROOT=/path/to/blpapi_cpp_3.x.x.xor set a directory at runtime, before the first request:
import xbbg
xbbg.set_sdk_path('/path/to/blpapi_cpp_3.x.x.x')xbbg.clear_sdk_path() returns to automatic detection.
import xbbg
print(xbbg.__version__)
print(xbbg.get_sdk_info())get_sdk_info() returns a dict with sources (every runtime source found, with versions), active (the source in use), and runtime_version. If importing the native extension fails, the error lists these options; see Troubleshooting.
With a Terminal on the same machine, no configuration is needed: the first request connects to localhost:8194. For anything else, configure the engine once before the first request:
import xbbg
xbbg.configure(host='localhost', port=8194)For Server API/B-PIPE authentication, ZFP, TLS, failover, SOCKS5, timeouts, and SDK logging, continue to Configuration.
The source distribution compiles the Rust extension: it needs Rust 1.88 or newer and the Bloomberg C++ SDK headers and libraries (BLPAPI_ROOT). In a repository checkout, scripts/sdktool.sh (macOS/Linux) or scripts/sdktool.ps1 (Windows) stages an SDK, and the repository README covers the development setup.
xbbg-langgraph, installed from source).Make your first request.
Desktop, B-PIPE, ZFP, TLS, failover, SOCKS5, authentication, and logging.
SDK discovery, import errors, and connection checks.