xbbg.blp
Generated from py-xbbg/src/xbbg/blp.py at release v1.8.1.
High-level xbbg request API: reference, historical, intraday.
This module provides the xbbg-compatible API for authorized Bloomberg environments, with support for multiple DataFrame backends via narwhals.
Architecture:
_endpointsowns typed async functions and their_EndpointPlanbuilders. Only execution crosses back through the callback installed below, intoarequestand its middleware; private modules never import this facade._engineowns lifecycle and scoped routing;_syncowns the managed loop shared by sync request wrappers and_streamingsubscription producers._technicalkeeps study vocabulary, requests, and IDE stub generation together.- Public names are re-exported here; only synchronous wrappers are generated.
Backend Objects
class Backend(str, Enum)Enum for selecting the data processing backend.
The backend determines which library is used for data manipulation and storage. Each backend has different performance characteristics and memory usage patterns.
Eager backends (full API support):
NATIVE– xbbg native Arrow carrier objectPYARROW– Apache Arrow Pythonpyarrow.TableNARWHALS– Backend-agnostic DataFrame APIPANDAS– Most widely used DataFrame libraryPOLARS– High-performance Rust-based DataFramesCUDF– GPU-accelerated DataFrames (NVIDIA RAPIDS)MODIN– Distributed pandas-like DataFrames
Lazy backends (deferred execution):
NARWHALS_LAZY– Narwhals with lazy evaluationPOLARS_LAZY– Polars LazyFrame for query optimisationDUCKDB– Embedded analytical SQL databaseDASK– Parallel computing with task schedulingIBIS– Portable DataFrame expressions (SQL backends)PYSPARK– Apache Spark distributed DataFramesSQLFRAME– SQL-based DataFrame abstraction
NATIVE
PYARROW
NARWHALS
PANDAS
POLARS
CUDF
MODIN
NARWHALS_LAZY
POLARS_LAZY
DUCKDB
DASK
IBIS
PYSPARK
SQLFRAME
arequest
async def arequest(
service: str | Service,
operation: str | Operation,
*,
request_operation: str | Operation | None = None,
securities: str | Sequence[str] | None = None,
security: str | None = None,
fields: str | Sequence[str] | None = None,
overrides: Mapping[str, Any] | Sequence[tuple[str, Any]] | OverrideSpec
| None = None,
security_overrides: Sequence[tuple[str, Sequence[tuple[str, Any]]]]
| None = None,
elements: Sequence[tuple[str, Any]] | None = None,
start_date: DateLike = None,
end_date: DateLike = None,
start_datetime: DateLike = None,
end_datetime: DateLike = None,
event_type: str | None = None,
event_types: Sequence[str] | None = None,
interval: int | None = None,
options: dict[str, Any] | Sequence[tuple[str, str]] | None = None,
field_types: dict[str, str] | None = None,
output: OutputMode | str = OutputMode.ARROW,
extractor: ExtractorHint | str | None = None,
format: Format | str | None = None,
include_security_errors: bool = False,
return_eids: bool = False,
on_delayed: str | None = None,
validate_fields: bool | None = None,
backend: Backend | str | None = None,
request_tz: str | None = None,
output_tz: str | None = None,
_raw: bool = False,
_field_type_default: str | None = None)Async generic Bloomberg request.
This is the low-level API for power users who need to:
- Send requests to arbitrary Bloomberg services
- Use operations not covered by the typed convenience functions
- Get raw JSON responses for debugging
For common use cases, prefer the typed functions: abdp, abdh, abds, abdib, abdtick.
Arguments:
service- Bloomberg service URI (e.g., Service.REFDATA or "//blp/refdata").operation- Request operation name (e.g., Operation.REFERENCE_DATA).request_operation- Actual Bloomberg operation name when usingOperation.RAW_REQUESTas the low-level escape hatch.securities- List of security identifiers (for multi-security requests).security- Single security identifier (for intraday requests).fields- List of field names to retrieve.overrides- Field overrides as dict, OverrideSpec, or list of (name, value) tuples. Nested override mappings insideovr()are per-security overrides; global pairs are merged first.security_overrides- Low-level per-security overrides, usually supplied by typed wrappers after normalizingovr()inputs.elements- Additional request elements as list of (name, value) tuples. Used for schema-driven parameters like intervalHasSeconds, periodicitySelection.start_date- Start date for historical requests. Accepts ISO 8601 string,YYYYMMDDstring,"today",datetime.date,datetime.datetime, or duck-typedpd.Timestamp.end_date- End date for historical requests. Same accepted shapes asstart_date.start_datetime- Start datetime for intraday requests. Accepts ISO 8601 string (with or without tz),datetime.datetime(naive or tz-aware), orpd.Timestamp. Naive values userequest_tz.end_datetime- End datetime for intraday requests. Same accepted shapes asstart_datetime.request_tz- For intraday requests, how naive datetimes are interpreted before sending to Bloomberg (UTC,local,exchange, aliases, or IANA). Resolved and converted to UTC in the Rust engine.output_tz- For intraday responses, relabel thetimecolumn to this zone (same instants; handled in the Rust engine).event_type- Event type for intraday bars (TRADE, BID, ASK, etc.).interval- Bar interval in minutes for intraday bars.options- Additional Bloomberg options as dict or list of (key, value) tuples.field_types- Manual type overrides for fields (for future type resolution).output- Output format: OutputMode.ARROW (default) or OutputMode.JSON.extractor- Override the auto-detected extractor:ExtractorHint.REFDATA,HISTDATA,BULK,INTRADAY_BAR,INTRADAY_TICK,GENERIC,BQL,BSRCH, orFIELD_INFO. UseExtractorHint.BULKfor bulk data fields. If None, auto-detected from operation.format- Output format:Format.LONG(default),Format.LONG_TYPED,Format.LONG_WITH_METADATA, orFormat.SEMI_LONG.include_security_errors- Include__SECURITY_ERROR__rows for failed securities on ReferenceData requests.return_eids- Request EID entitlement metadata for ReferenceDataRequest (including BDS bulk data), HistoricalDataRequest, IntradayBarRequest, and IntradayTickRequest.on_delayed- Delayed-data check for ReferenceDataRequest (bdp shape, not bulk), HistoricalDataRequest, IntradayBarRequest, andIntradayTickRequest-"warn","raise", or"ignore"; seeabdp.None(default) skips the check.validate_fields- Optional per-request override for field validation.Trueforces strict validation,Falsedisables it, andNonefollows engine-level validation mode.backend- DataFrame backend to return. If None, uses global default.
Returns:
DataFrame/Table in the requested format.
Example:
# Query field metadata (//blp/apiflds service)
df = await arequest(
Service.APIFLDS,
Operation.FIELD_INFO,
fields=["PX_LAST", "VOLUME"],
)
# Get raw JSON for debugging
json_table = await arequest(
Service.REFDATA,
Operation.REFERENCE_DATA,
securities=["AAPL US Equity"],
fields=["PX_LAST"],
output=OutputMode.JSON,
)
# Custom Bloomberg request (power user)
df = await arequest(
"//blp/refdata",
"ReferenceDataRequest",
securities=["AAPL US Equity"],
fields=["PX_LAST"],
)
# Raw request marker with explicit Bloomberg operation
df = await arequest(
Service.REFDATA,
Operation.RAW_REQUEST,
request_operation=Operation.REFERENCE_DATA,
extractor=ExtractorHint.REFDATA,
securities=["AAPL US Equity"],
fields=["PX_LAST"],
)request
def request(service: str | Service,
operation: str | Operation,
*,
request_operation: str | Operation | None = None,
securities: str | Sequence[str] | None = None,
security: str | None = None,
fields: str | Sequence[str] | None = None,
overrides: Mapping[str, Any] | Sequence[tuple[str, Any]]
| OverrideSpec | None = None,
security_overrides: Sequence[tuple[str, Sequence[tuple[str, Any]]]]
| None = None,
elements: Sequence[tuple[str, Any]] | None = None,
start_date: DateLike = None,
end_date: DateLike = None,
start_datetime: DateLike = None,
end_datetime: DateLike = None,
event_type: str | None = None,
event_types: Sequence[str] | None = None,
interval: int | None = None,
options: dict[str, Any] | Sequence[tuple[str, str]] | None = None,
field_types: dict[str, str] | None = None,
output: OutputMode | str = OutputMode.ARROW,
extractor: ExtractorHint | str | None = None,
format: Format | str | None = None,
include_security_errors: bool = False,
return_eids: bool = False,
on_delayed: str | None = None,
validate_fields: bool | None = None,
backend: Backend | str | None = None,
request_tz: str | None = None,
output_tz: str | None = None,
_raw: bool = False) -> DataFrameResultSync generic Bloomberg request. See arequest for details.
aseat_type
async def aseat_type() -> strReturn the seat type for the lazily authorized Bloomberg identity.
The engine authorizes on first use: configured auth is used when present, otherwise the Desktop terminal OS-logon user is used. First use may take a moment and timeout failures are retryable.
seat_type
def seat_type() -> strSync identity seat type. See aseat_type for details.
acheck_entitlements
async def acheck_entitlements(
eids: Sequence[int],
service: str = Service.REFDATA.value) -> EntitlementReportCheck EID entitlements for the lazily authorized Bloomberg identity.
The engine authorizes on first use: configured auth is used when present, otherwise the Desktop terminal OS-logon user is used. First use may take a moment and timeout failures are retryable.
check_entitlements
def check_entitlements(
eids: Sequence[int],
service: str = Service.REFDATA.value) -> EntitlementReportSync EID entitlement check. See acheck_entitlements for details.
adelay_status
async def adelay_status(
tickers: str | Sequence[str],
*,
check_identity: bool = False,
backend: Backend | str | None = None) -> DataFrameResultReport whether Bloomberg delivers delayed data for each ticker.
Sends one ReferenceDataRequest for IS_DELAYED_STREAM, EXCHANGE_DELAY, EXCH_CODE, FEED_EID1-FEED_EID4, and FEED_DELAYED_EID1. Bloomberg evaluates IS_DELAYED_STREAM for the requesting session, so delayed reflects this login's entitlements.
Arguments:
tickers- Single ticker or list of tickers. Input order is kept and duplicates are removed.check_identity- Also check the authorized identity's entitlement to each ticker's real-time and delayed feed EIDs on//blp/mktdata. This needs SAPI/B-PIPE auth (configure(auth_method=...)) or an EMRS-enrolled Desktop user; otherwise the call fails with the identity error. The default works on any Desktop Terminal.backend- DataFrame backend to return. If None, uses global default.
Returns:
One row per ticker with columns ticker (or security with key_column="security"), delayed (null when Bloomberg did not say), delay_minutes (null when real-time or unparseable), exchange_delay (raw EXCHANGE_DELAY text), exch_code, realtime_eid1-realtime_eid4 and delayed_eid (feed EIDs, null when absent), realtime_entitled and delayed_entitled (null unless check_identity and the EIDs exist), and error (Bloomberg security error message).
Example:
status = await adelay_status(["AAPL US Equity", "VOD LN Equity"])delay_status
def delay_status(tickers: str | Sequence[str],
*,
check_identity: bool = False,
backend: Backend | str | None = None) -> DataFrameResultSync delayed-data status. See adelay_status for details.
aidentity_is_authorized
async def aidentity_is_authorized(
service: str = Service.REFDATA.value) -> boolReturn whether the lazily authorized identity is authorized for service.
The engine authorizes on first use: configured auth is used when present, otherwise the Desktop terminal OS-logon user is used. First use may take a moment and timeout failures are retryable.
identity_is_authorized
def identity_is_authorized(service: str = Service.REFDATA.value) -> boolSync identity authorization check. See aidentity_is_authorized for details.
abdp
async def abdp(tickers: str | Sequence[str],
flds: str | Sequence[str] | None = None,
*,
backend: Backend | str | None = None,
format: Format | str | None = None,
field_types: dict[str, str] | None = None,
include_security_errors: bool = False,
return_eids: bool = False,
on_delayed: str | None = None,
validate_fields: bool | None = None,
**kwargs)Async Bloomberg reference data (BDP).
Arguments:
tickers- Single ticker or list of tickers.flds- Single field or list of fields to query.backend- DataFrame backend to return. If None, uses global default. Supports lazy backends: 'polars_lazy', 'narwhals_lazy', 'duckdb'.format- Output format. The leadingtickercolumn is namedsecuritywhen the engine setskey_column="security". Options:- Format.LONG (default): ticker, field, value (strings)
- Format.LONG_TYPED: ticker, field, value_f64, value_i64, value_str, value_bool, value_date, value_ts, value_time. Dates use Date32, full datetimes use UTC timestamps, and time-only values use Time64 microseconds in value_time.
- Format.LONG_WITH_METADATA: ticker, field, value, dtype
field_types- Manual type overrides for fields (e.g., {'VOLUME': 'int64'}). If None, types are auto-resolved from Bloomberg field metadata.include_security_errors- Include__SECURITY_ERROR__rows for securities that Bloomberg rejected.return_eids- Request EID metadata. Native Arrow results expose.eid_data; pandas stores it inattrs["xbbg_eid_data"]; PyArrow preservesxbbg.eid_datain schema metadata. Polars and DuckDB have no stable metadata channel.on_delayed- Check whether Bloomberg is delivering delayed data for these tickers."warn"emits oneBlpDelayedDataWarningper delayed ticker (for every backend, including polars and duckdb),"raise"fails the call withBlpRequestErrornaming the delayed tickers, and"ignore"only records the status.None(default) skips the check. The flags ride on the same request and surface per ticker as ``{"delayed": bool,"delay_minutes"- int | None}: native Arrow results expose.delayed; pandas stores it inattrs["xbbg_delayed"]; PyArrow preservesxbbg.delayed`` in schema metadata.validate_fields- Optional per-request override for field validation.Trueforces strict validation,Falsedisables it, andNonefollows engine-level validation mode.**kwargs- Bloomberg overrides and infrastructure options.
Returns:
DataFrame in long format with columns: ticker, field, value. For lazy backends, returns LazyFrame that must be collected.
Example:
# Async usage
df = await abdp("AAPL US Equity", ["PX_LAST", "VOLUME"])
# Concurrent requests
dfs = await asyncio.gather(
abdp("AAPL US Equity", "PX_LAST"),
abdp("MSFT US Equity", "PX_LAST"),
)abdh
async def abdh(tickers: str | Sequence[str],
flds: str | Sequence[str] | None = None,
start_date: DateLike = None,
end_date: DateLike = "today",
*,
backend: Backend | str | None = None,
format: Format | str | None = None,
field_types: dict[str, str] | None = None,
validate_fields: bool | None = None,
return_eids: bool = False,
on_delayed: str | None = None,
**kwargs)Async Bloomberg historical data (BDH).
Arguments:
tickers- Single ticker or list of tickers.flds- Single field or list of fields. Defaults to ['PX_LAST'].start_date- Start date. Defaults to 8 weeks before end_date.end_date- End date. Defaults to 'today'.backend- DataFrame backend to return. If None, uses global default. Supports lazy backends: 'polars_lazy', 'narwhals_lazy', 'duckdb'.format- Output format. The leadingtickercolumn is namedsecuritywhen the engine setskey_column="security". Options:- Format.LONG (default): ticker, date, field, value (strings)
- Format.LONG_TYPED: ticker, date, field, value_f64, value_i64, value_str, value_bool, value_date, value_ts, value_time. Dates use Date32, full datetimes use UTC timestamps, and time-only values use Time64 microseconds in value_time.
- Format.LONG_WITH_METADATA: ticker, date, field, value, dtype
field_types- Manual type overrides for fields (e.g., {'VOLUME': 'int64'}). If None, types are auto-resolved from Bloomberg field metadata.validate_fields- Optional per-request override for field validation.Trueforces strict validation,Falsedisables it, andNonefollows engine-level validation mode.return_eids- Request EID metadata. Native Arrow results expose.eid_data; pandas stores it inattrs["xbbg_eid_data"]; PyArrow preservesxbbg.eid_datain schema metadata. Polars and DuckDB have no stable metadata channel.on_delayed- Delayed-data check; seeabdpfor the policies and the.delayed/attrs["xbbg_delayed"]metadata. Runs one extra small reference request, and only whenend_dateis on or after yesterday (UTC), because a delayed feed only changes today's row; older windows skip the check and carry noxbbg.delayed.**kwargs- Additional overrides and infrastructure options.adjust- Adjustment type ('all', 'dvd', 'split', '-', None).
Returns:
DataFrame in long format with columns: ticker, date, field, value. For lazy backends, returns LazyFrame that must be collected.
Example:
# Async usage
df = await abdh("AAPL US Equity", "PX_LAST", start_date="2024-01-01")
# Concurrent requests
dfs = await asyncio.gather(
abdh("AAPL US Equity", "PX_LAST"),
abdh("MSFT US Equity", "PX_LAST"),
)abds
async def abds(tickers: str | Sequence[str],
flds: str,
*,
backend: Backend | str | None = None,
validate_fields: bool | None = None,
return_eids: bool = False,
**kwargs)Async Bloomberg bulk data (BDS).
Arguments:
tickers- Single ticker or list of tickers.flds- Single field name (bulk fields return multiple rows).backend- DataFrame backend to return. If None, uses global default.validate_fields- Optional per-request override for field validation.Trueforces strict validation,Falsedisables it, andNonefollows engine-level validation mode.return_eids- Request EID metadata. Native Arrow results expose.eid_data; pandas stores it inattrs["xbbg_eid_data"]; PyArrow preservesxbbg.eid_datain schema metadata. Polars and DuckDB have no stable metadata channel.**kwargs- Bloomberg overrides and infrastructure options.
Returns:
DataFrame with one row per Bloomberg bulk row. The only xbbg-added columns are ticker (security with key_column="security") and field; bulk subfield columns preserve Bloomberg's labels exactly as emitted, including spaces, punctuation, and case. Higher-level helpers must rename their own semantic outputs.
Example:
df = await abds("AAPL US Equity", "DVD_Hist_All")
df = await abds("SPX Index", "INDX_MEMBERS", backend="polars")abdib
async def abdib(ticker: str,
dt: DateLike = None,
session: str = "allday",
typ: str = "TRADE",
*,
start_datetime: DateLike = None,
end_datetime: DateLike = None,
interval: int = 1,
backend: Backend | str | None = None,
request_tz: str | None = None,
output_tz: str | None = None,
return_eids: bool = False,
on_delayed: str | None = None,
**kwargs)Async Bloomberg intraday bar data (BDIB).
Arguments:
ticker- Ticker name.dt- Date to download (for single-day requests).session- Trading session name. Ignored when start_datetime/end_datetime provided.typ- Event type (TRADE, BID, ASK, etc.).start_datetime- Explicit start datetime for multi-day requests.end_datetime- Explicit end datetime for multi-day requests.interval- Bar interval in minutes (default: 1), or seconds if intervalHasSeconds=True.backend- DataFrame backend to return. If None, uses global default.request_tz- How naivestart_datetime/end_datetime(and full-daydtwindow) are interpreted before Bloomberg:UTC(default when omitted),local,exchange(uses this ticker),NY/LN/TK/HK, another ticker string, or an IANA zone. Conversion to UTC is done in the Rust engine.output_tz- Relabel thetimecolumn to this zone (same instants; Rust engine).return_eids- Request EID metadata. Native Arrow results expose.eid_data; pandas stores it inattrs["xbbg_eid_data"]; PyArrow preservesxbbg.eid_datain schema metadata. Polars and DuckDB have no stable metadata channel.on_delayed- Delayed-data check; seeabdpfor the policies and the.delayed/attrs["xbbg_delayed"]metadata. Runs one extra small reference request, and only when the requested window ends later than 24 hours ago, since a delayed feed's data stops at now minus the delay; older windows skip the check and carry noxbbg.delayed.**kwargs- Additional Bloomberg options (e.g., intervalHasSeconds, gapFillInitialBar, or 0.x request-element aliases such asPoints=1). Pass true Bloomberg field overrides viaoverrides={...}.
Returns:
DataFrame with intraday bar data.
Example:
# 1-minute bars (default)
df = await abdib("AAPL US Equity", dt="2024-12-01")
# 5-minute bars with explicit datetime range
df = await abdib(
"AAPL US Equity",
start_datetime="2024-12-01 09:30",
end_datetime="2024-12-01 16:00",
interval=5,
)
# 10-second bars
df = await abdib("AAPL US Equity", dt="2024-12-01", interval=10, intervalHasSeconds=True)abdtick
async def abdtick(ticker: str,
start_datetime: DateLike,
end_datetime: DateLike,
*,
event_types: Sequence[str] | None = None,
backend: Backend | str | None = None,
request_tz: str | None = None,
output_tz: str | None = None,
return_eids: bool = False,
on_delayed: str | None = None,
**kwargs)Async Bloomberg tick data (BDTICK).
Arguments:
ticker- Ticker name.start_datetime- Start datetime.end_datetime- End datetime.event_types- Event types to retrieve. Defaults to ["TRADE"].Options- TRADE, BID, ASK, BID_BEST, ASK_BEST, MID_PRICE, AT_TRADE, BEST_BID, BEST_ASK.backend- DataFrame backend to return. If None, uses global default.request_tz- How naive datetimes are interpreted before Bloomberg (seeabdib).output_tz- Relabeltimecolumn (same instants; Rust engine).return_eids- Request EID metadata. Native Arrow results expose.eid_data; pandas stores it inattrs["xbbg_eid_data"]; PyArrow preservesxbbg.eid_datain schema metadata. Polars and DuckDB have no stable metadata channel.on_delayed- Delayed-data check; seeabdpfor the policies and the.delayed/attrs["xbbg_delayed"]metadata. Runs one extra small reference request, and only when the requested window ends later than 24 hours ago, since a delayed feed's data stops at now minus the delay; older windows skip the check and carry noxbbg.delayed.**kwargs- Additional Bloomberg options. Schema-recognized request elements and 0.x request-element aliases such asPoints=1may be passed as individual keyword arguments. Pass true Bloomberg field overrides viaoverrides={...}.
Returns:
DataFrame with tick data.
Example:
df = await abdtick("AAPL US Equity", "2024-12-01 09:30", "2024-12-01 10:00")
df = await abdtick(
"AAPL US Equity", "2024-12-01 09:30", "2024-12-01 10:00", event_types=["TRADE", "BID", "ASK"]
)
df = await abdtick("AAPL US Equity", "2024-12-01 09:30", "2024-12-01 10:00", backend="polars")abql
async def abql(expression: str,
*,
backend: Backend | str | None = None,
app_name: str | None = None) -> DataFrameResultAsync Bloomberg Query Language (BQL) request.
BQL is Bloomberg's powerful query language for financial analytics. It allows you to query data across universes of securities with complex filters, calculations, and time series operations.
Arguments:
expression- BQL expression string.backend- DataFrame backend to return. If None, uses global default.app_name- Bloomberg-authorized application name to set asclientContext.appNamefor this request, overriding any enginebql_app_name. If None, the engine default applies when configured; otherwise the request element is omitted.
Returns:
DataFrame with columns: id, <field1>, <field2>, ... Where 'id' is the security identifier from the BQL universe.
Example:
# Get price for a single security
df = await abql("get(px_last) for('AAPL US Equity')")
# Select an explicitly authorized application context
df = await abql(
"get(px_last) for('AAPL US Equity')",
app_name="example-authorized-bql-app",
)
# Get multiple fields
df = await abql("get(px_last, volume) for('AAPL US Equity')")
# Holdings of an ETF
df = await abql("get(id_isin, weights) for(holdings('SPY US Equity'))")
# Index members
df = await abql("get(px_last) for(members('SPX Index'))")
# With filters
df = await abql("get(px_last, pe_ratio) for(members('SPX Index')) with(pe_ratio > 20)")
# Time series
df = await abql("get(px_last) for('AAPL US Equity') with(dates=range(-5d, 0d))")absrch
async def absrch(domain: str,
*,
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultAsync Bloomberg Search (BSRCH) request.
BSRCH executes saved Bloomberg searches and returns matching securities.
Arguments:
domain- The saved search domain/name (e.g., "FI:SOVR", "COMDTY:PRECIOUS").backend- DataFrame backend to return. If None, uses global default.**kwargs- Search parameters. Direct keyword arguments and explicitoverrides={...}mappings or(name, value)pairs are sent as ExcelGetGrid overrides.Domainis sent as the request's top-level domain element.
Returns:
DataFrame with columns from the saved search results.
Example:
# Sovereign bonds
df = await absrch("FI:SOVR")
# With additional parameters
df = await absrch("COMDTY:WEATHER", LOCATION="NYC", MODEL="GFS")abeqs
async def abeqs(screen: str,
*,
asof: str | None = None,
screen_type: str = "PRIVATE",
group: str = "General",
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultAsync Bloomberg Equity Screening (BEQS) request.
Execute a saved Bloomberg equity screen and return matching securities.
Arguments:
screen- Screen name as saved in Bloomberg.asof- As-of date for the screen. Accepts ISO 8601 /YYYYMMDDstring,datetime.date,datetime.datetime, orpd.Timestamp.screen_type- Screen type - "PRIVATE" (custom) or "GLOBAL" (Bloomberg).group- Group name if screen is organized into groups.backend- DataFrame backend to return. If None, uses global default.**kwargs- Additional request parameters.
Returns:
DataFrame with columns from the screen results (security, fieldData, etc.).
Example:
# Run a private screen
df = await abeqs("MyScreen")
# Run with as-of date
df = await abeqs("MyScreen", asof="20240101")
# Run a Bloomberg global screen
df = await abeqs("TOP_DECL_DVD", screen_type="GLOBAL")ablkp
async def ablkp(query: str,
*,
yellowkey: str = "YK_FILTER_NONE",
language: str = "LANG_OVERRIDE_NONE",
max_results: int = 20,
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultAsync Bloomberg security lookup (BLKP) request.
Search for securities by company name or partial ticker.
Arguments:
query- Search query (company name or partial ticker).yellowkey- Asset class filter. Common values:- "YK_FILTER_NONE" (default, all asset classes)
- "YK_FILTER_EQTY" (equities only)
- "YK_FILTER_CORP" (corporate bonds)
- "YK_FILTER_GOVT" (government bonds)
- "YK_FILTER_INDX" (indices)
- "YK_FILTER_CURR" (currencies)
- "YK_FILTER_CMDT" (commodities)
language- Language override for results.max_results- Maximum number of results (default: 20, max: 1000).backend- DataFrame backend to return. If None, uses global default.**kwargs- Additional request parameters.
Returns:
DataFrame with columns: security, description, and other result fields.
Example:
# Search for Apple
df = await ablkp("Apple")
# Search for equities only
df = await ablkp("NVDA", yellowkey="YK_FILTER_EQTY")
# Get more results
df = await ablkp("Microsoft", max_results=50)abport
async def abport(portfolio: str,
fields: str | Sequence[str],
*,
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultAsync Bloomberg portfolio data (BPORT) request.
Get portfolio holdings and related data using PortfolioDataRequest.
Arguments:
portfolio- Bloomberg PortfolioDataRequest security/portfolio ID string, not the PORT display name (for example, "UXXXXXXX-X Client" from PRTU/PORT).fields- Field name or list of fields (e.g., "PORTFOLIO_MWEIGHT").backend- DataFrame backend to return. If None, uses global default.**kwargs- Additional request parameters/overrides.
Returns:
DataFrame with portfolio data.
Example:
# Get portfolio overview data. Use the Bloomberg portfolio ID/security
# string, not the human-readable PORT display name.
df = await abport("UXXXXXXX-X Client", "PORTFOLIO_DATA")
# Get portfolio weights
df = await abport("UXXXXXXX-X Client", "PORTFOLIO_MWEIGHT")abcurves
async def abcurves(*,
country: str | None = None,
currency: str | None = None,
curve_type: str | None = None,
subtype: str | None = None,
curveid: str | None = None,
bbgid: str | None = None,
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultAsync Bloomberg yield curve list (BCURVES) request.
Search for yield curves by country, currency, type, or other filters.
Arguments:
country- Country code filter (e.g., "US", "GB", "DE").currency- Currency code filter (e.g., "USD", "EUR", "GBP").curve_type- Curve type filter (e.g., "GOVERNMENT", "CORPORATE").subtype- Curve subtype filter.curveid- Specific curve ID to look up.bbgid- Bloomberg Global ID filter.backend- DataFrame backend to return. If None, uses global default.**kwargs- Additional request parameters.
Returns:
DataFrame with yield curve information.
Example:
# List US yield curves
df = await abcurves(country="US")
# List USD government curves
df = await abcurves(currency="USD", curve_type="GOVERNMENT")
# Look up specific curve
df = await abcurves(curveid="YCSW0023 Index")abgovts
async def abgovts(query: str | None = None,
*,
partial_match: bool = True,
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultAsync Bloomberg government securities list (BGOVTS) request.
Search for government securities by ticker or name.
Arguments:
query- Search query (ticker or partial name).partial_match- If True, match partial ticker names (default: True).backend- DataFrame backend to return. If None, uses global default.**kwargs- Additional request parameters.
Returns:
DataFrame with government securities information.
Example:
# Search for US Treasury securities
df = await abgovts("T")
# Search for German government bonds
df = await abgovts("DBR")
# Exact match only
df = await abgovts("T 2.5 05/15/24", partial_match=False)abqr
async def abqr(ticker: str,
date_offset: str | None = None,
start_date: DateLike = None,
end_date: DateLike = None,
*,
event_types: Sequence[str] | None = None,
include_broker_codes: bool = True,
include_spread_price: bool = False,
include_yield: bool = False,
include_condition_codes: bool = False,
include_exchange_codes: bool = False,
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultAsync Bloomberg Quote Request (BQR).
Retrieves dealer quote data using IntradayTickRequest with BID/ASK events. Emulates the Excel =BQR() function.
Arguments:
ticker- Security identifier. Supports Bloomberg tickers with pricing source qualifiers (e.g., 'IBM US Equity@MSG1', '/isin/US037833FB15@MSG1').date_offset- Date offset from now (e.g., '-2d', '-1w', '-3h'). Mutually exclusive with start_date/end_date.start_date- Start date (e.g., '2024-01-15'). Defaults to 2 days ago.end_date- End date (e.g., '2024-01-17'). Defaults to today.event_types- Event types to retrieve. Defaults to ['BID', 'ASK'].include_broker_codes- Include broker/dealer codes (default True).include_spread_price- Include spread price for bonds (default False).include_yield- Include yield data for bonds (default False).include_condition_codes- Include trade condition codes (default False).include_exchange_codes- Include exchange codes (default False).backend- DataFrame backend to return. If None, uses global default.**kwargs- Additional options.
Returns:
DataFrame with columns: ticker (security with key_column="security"), time, event_type, price, size, plus optional broker_buy, broker_sell, spread_price, etc., sorted by time. Shaping matches xbbg.ext.abqr: schema metadata is kept, and a field of generic (path) output is a string column when it holds any text and otherwise keeps the extractor's float64 values.
Raises:
RuntimeError-include_broker_codesis set and the quote rows carry no broker codes.
Example:
# With date offset (like Excel BQR)
df = await abqr("IBM US Equity@MSG1", date_offset="-2d")
# Bond with broker codes and spread
df = await abqr(
"US037833FB15@MSG1 Corp",
date_offset="-2d",
include_broker_codes=True,
include_spread_price=True,
)
# With explicit date range
df = await abqr(
"XYZ 4.5 01/15/30@MSG1 Corp",
start_date="2024-01-15",
end_date="2024-01-17",
)
# Trade events only
df = await abqr(
"XYZ 4.5 01/15/30@MSG1 Corp",
date_offset="-1d",
event_types=["TRADE"],
)bqr
def bqr(ticker: str,
date_offset: str | None = None,
start_date: DateLike = None,
end_date: DateLike = None,
*,
event_types: Sequence[str] | None = None,
include_broker_codes: bool = False,
include_spread_price: bool = False,
include_yield: bool = False,
include_condition_codes: bool = False,
include_exchange_codes: bool = False,
backend: Backend | str | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg Quote Request (BQR). See abqr for details.
abflds
async def abflds(fields: str | list[str] | None = None,
*,
search_spec: str | None = None,
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultAsync Bloomberg field metadata lookup (BFLDS).
Unified field function: get metadata for specific fields, or search by keyword.
Arguments:
fields- Single field or list of fields to get metadata for. Mutually exclusive with search_spec.search_spec- Search term to find fields by name/description. Mutually exclusive with fields.backend- DataFrame backend to return. If None, uses global default.**kwargs- Infrastructure options (e.g., port, server).
Returns:
DataFrame with field information or search results.
Raises:
ValueError- If neither fields nor search_spec is provided, or both are provided.
Example:
# Get info for specific fields
df = await abflds(fields=["PX_LAST", "VOLUME"])
# Search for fields by keyword
df = await abflds(search_spec="vwap")bflds
def bflds(fields: str | list[str] | None = None,
*,
search_spec: str | None = None,
backend: Backend | str | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg field metadata lookup (BFLDS). See abflds for details.
abfld
Alias of abflds.
bfld
Alias of bflds.
afieldInfo
async def afieldInfo(fields: str | list[str],
*,
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultGet metadata about Bloomberg fields (async).
Convenience wrapper around abflds(fields=...).
Arguments:
fields- Single field or list of fields to get metadata for.backend- DataFrame backend to return. If None, uses global default.**kwargs- Infrastructure options.
Returns:
DataFrame with field information.
Example:
df = await afieldInfo(["PX_LAST", "VOLUME"])fieldInfo
def fieldInfo(fields: str | list[str],
*,
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultSynchronous wrapper around afieldInfo, generated at import time with the same signature and docstring.
afieldSearch
async def afieldSearch(searchterm: str,
*,
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultSearch for Bloomberg fields by keyword (async).
Convenience wrapper around abflds(search_spec=...).
Arguments:
searchterm- Search term to find fields by name/description.backend- DataFrame backend to return. If None, uses global default.**kwargs- Infrastructure options.
Returns:
DataFrame with search results.
Example:
df = await afieldSearch("vwap")fieldSearch
def fieldSearch(searchterm: str,
*,
backend: Backend | str | None = None,
**kwargs) -> DataFrameResultSynchronous wrapper around afieldSearch, generated at import time with the same signature and docstring.
bdp
def bdp(tickers: str | Sequence[str],
flds: str | Sequence[str] | None = None,
*,
backend: Backend | str | None = None,
format: Format | str | None = None,
field_types: dict[str, str] | None = None,
include_security_errors: bool = False,
return_eids: bool = False,
on_delayed: str | None = None,
validate_fields: bool | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg reference data (BDP). See abdp for details.
bdh
def bdh(tickers: str | Sequence[str],
flds: str | Sequence[str] | None = None,
start_date: DateLike = None,
end_date: DateLike = "today",
*,
backend: Backend | str | None = None,
format: Format | str | None = None,
field_types: dict[str, str] | None = None,
validate_fields: bool | None = None,
return_eids: bool = False,
on_delayed: str | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg historical data (BDH). See abdh for details.
bds
def bds(tickers: str | Sequence[str],
flds: str,
*,
backend: Backend | str | None = None,
validate_fields: bool | None = None,
return_eids: bool = False,
**kwargs: Any) -> DataFrameResultSync Bloomberg bulk data (BDS). See abds for details.
bdib
def bdib(ticker: str,
dt: DateLike = None,
session: str = "allday",
typ: str = "TRADE",
*,
start_datetime: DateLike = None,
end_datetime: DateLike = None,
interval: int = 1,
backend: Backend | str | None = None,
request_tz: str | None = None,
output_tz: str | None = None,
return_eids: bool = False,
on_delayed: str | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg intraday bar data (BDIB). See abdib for details.
bdtick
def bdtick(ticker: str,
start_datetime: DateLike,
end_datetime: DateLike,
*,
event_types: Sequence[str] | None = None,
backend: Backend | str | None = None,
request_tz: str | None = None,
output_tz: str | None = None,
return_eids: bool = False,
on_delayed: str | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg tick data (BDTICK). See abdtick for details.
bql
def bql(expression: str,
*,
backend: Backend | str | None = None,
app_name: str | None = None) -> DataFrameResultSync Bloomberg Query Language (BQL) request. See abql for details.
bsrch
def bsrch(domain: str,
*,
backend: Backend | str | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg Search (BSRCH) request. See absrch for details.
beqs
def beqs(screen: str,
*,
asof: str | None = None,
screen_type: str = "PRIVATE",
group: str = "General",
backend: Backend | str | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg Equity Screening (BEQS) request. See abeqs for details.
blkp
def blkp(query: str,
*,
yellowkey: str = "YK_FILTER_NONE",
language: str = "LANG_OVERRIDE_NONE",
max_results: int = 20,
backend: Backend | str | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg security lookup (BLKP) request. See ablkp for details.
bport
def bport(portfolio: str,
fields: str | Sequence[str],
*,
backend: Backend | str | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg portfolio data (BPORT) request. See abport for details.
bcurves
def bcurves(*,
country: str | None = None,
currency: str | None = None,
curve_type: str | None = None,
subtype: str | None = None,
curveid: str | None = None,
bbgid: str | None = None,
backend: Backend | str | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg yield curve list (BCURVES) request. See abcurves for details.
bgovts
def bgovts(query: str | None = None,
*,
partial_match: bool = True,
backend: Backend | str | None = None,
**kwargs: Any) -> DataFrameResultSync Bloomberg government securities list (BGOVTS) request. See abgovts for details.
Tick Objects
@dataclass
class Tick()Single tick data point from a subscription.
Attributes:
ticker- Security identifierfield- Bloomberg field namevalue- Field value (float, int, str, bool, datetime, or None)timestamp- Time the tick was received
ticker
Type: str
field
Type: str
value
Type: TickValue
timestamp
Type: datetime
Subscription Objects
class Subscription()Subscription handle with async iteration and dynamic control.
Supports:
- Async iteration:
async for tick in sub - Dynamic add/remove:
await sub.add(['MSFT US Equity']) - Context manager:
async with xbbg.asubscribe(...) as sub: - Explicit unsubscribe:
await sub.unsubscribe(drain=True)
Example:
sub = await xbbg.asubscribe(["AAPL US Equity"], ["LAST_PRICE", "BID"])
async for batch in sub:
# batch is an xbbg.ArrowTable by default; use raw=True for ArrowRecordBatch
print(batch.to_pylist())
if should_add_msft:
await sub.add(["MSFT US Equity"])
await sub.unsubscribe()__init__
def __init__(py_sub,
raw: bool,
backend: Backend | str | None,
tick_mode: bool = False,
topic_normalizer: Callable[[str | Sequence[str]], list[str]]
| None = None)Initialize subscription wrapper.
Arguments:
py_sub- The underlying PySubscription from Rustraw- If True, yield raw ArrowRecordBatch wrappersbackend- Explicit DataFrame backend for conversion; None yields native ArrowTabletick_mode- If True, convert batches to dicts (implies raw=True)topic_normalizer- Normalizes add/remove inputs to subscribed Bloomberg topics
deliveries
def deliveries(*,
backend: Backend | str | None = None,
raw: bool = False) -> DeliveryStreamRead gap-aware batch envelopes, independently of legacy tick output.
The default data is a native :class:xbbg.ArrowTable. Pass backend for any existing batch backend or raw=True for native ArrowRecordBatch wrappers. State and drop-oldest subscriptions must use this view rather than plain iteration or plain draining.
delivery
@property
def delivery() -> strThe selected delivery mode: "deltas" or "state".
requires_deliveries
@property
def requires_deliveries() -> boolWhether effective native settings require marked batch consumption.
add
async def add(tickers: str | list[str],
aliases: Mapping[str, str] | None = None) -> NoneAdd tickers to subscription dynamically.
Arguments:
tickers- Single ticker or list of tickers to addaliases- Bloomberg topic to consumer label mapping. Labels appear in rows, status, andremove.
add_fields
async def add_fields(fields: str | Sequence[str]) -> NoneAdd projected fields; shared upstream field unions grow but never shrink.
latest
def latest(backend: Backend | str | None = None) -> DataFrameResultReturn the materialized image, independently of the iteration output mode.
Columns are topic (consumer label), last_update (UTC), live, delayed, and projected data fields. Unknown values and explicit clears are null. backend follows ordinary request results.
remove
async def remove(tickers: str | list[str]) -> NoneRemove consumer labels (or unaliased tickers) dynamically.
Arguments:
tickers- Single consumer label or list of labels to remove
tickers
@property
def tickers() -> list[str]Currently active tickers.
failed_tickers
@property
def failed_tickers() -> list[str]Tickers Bloomberg rejected or terminated.
failures
@property
def failures() -> list[dict[str, str]]Non-fatal per-ticker subscription failures.
Each entry contains: - ticker: Bloomberg topic string - reason: Bloomberg failure detail - kind: "failure" or "terminated"
topic_states
@property
def topic_states() -> dict[str, dict[str, int | str | bool | None]]Topic lifecycle, delayed flag, and upstream topic keyed by consumer label.
field_errors
@property
def field_errors() -> dict[str, dict[str, str]]Rejected explicit fields, keyed by consumer label then field name.
session_status
@property
def session_status() -> dict[str, int | str]Session-level connection status for this subscription.
admin_status
@property
def admin_status() -> dict[str, int | bool | None]Bloomberg admin/slow-consumer status for this subscription.
service_status
@property
def service_status() -> dict[str, dict[str, int | bool]]Service availability status keyed by Bloomberg service name.
events
@property
def events() -> list[dict[str, str | int | None]]Bounded event history, including warnings and DataLoss/FeedRecovered notices.
status
@property
def status() -> dict[str, Any]Combined operational status snapshot.
fields
@property
def fields() -> list[str]Subscribed fields.
is_active
@property
def is_active() -> boolWhether the subscription is still active.
all_failed
@property
def all_failed() -> boolWhether every requested ticker has ended in failure/termination.
stats
@property
def stats() -> dictSubscription metrics.
Returns:
dict with keys:
- messages_received: int - total messages received from Bloomberg
- dropped_batches: int - native updates dropped due to overflow
- batches_sent: int - batches successfully sent to Python
- slow_consumer: bool - True if DATALOSS was received
- data_loss_events: int - total Bloomberg data-loss signals observed
- last_message_us: int - latest receive timestamp seen from Bloomberg
- last_data_loss_us: int - latest data-loss timestamp seen from Bloomberg
- effective_overflow_policy: str - actual runtime policy used by the Rust stream
unsubscribe
async def unsubscribe(drain: bool = False) -> list[Any] | NoneClose subscription and optionally drain remaining data.
Arguments:
drain- If True, return all unread values using the same representation selected for iteration. State/drop-oldest handles must drain throughsub.deliveries().unsubscribe(drain=True)instead. A plain advanced drain closes the subscription before raising.
Returns:
List of remaining values if drain=True, else None.
Raises:
BlpError- An unread stream failure or cleanup failure. Buffered partial results are not returned when draining fails.
SubscriptionDelivery Objects
@dataclass(frozen=True, slots=True)
class SubscriptionDelivery()A batch plus delivery semantics that survive every backend conversion.
kind is "deltas" or "state". State rows contain the complete projected image and a Boolean valid column; invalid rows are not current values. gap_before applies immediately before this batch, not each row.
kind
Type: str
data
Type: Any
gap_before
Type: SubscriptionGap | None
SubscriptionGap Objects
@dataclass(frozen=True, slots=True)
class SubscriptionGap()Local raw-queue loss preceding a delivery, counted in source updates.
dropped_updates
Type: int
cause
@property
def cause() -> strThe reason updates were omitted from this consumer's delta stream.
DeliveryStream Objects
class DeliveryStream()Async batch-delivery view sharing its subscription's native lifecycle.
Native reads return unpublished receipts, built on a native completion thread without converting the batch. Backend conversion runs here, on the consuming event loop, before a receipt is committed; failed or unpublished conversions leave the batch and its gap unread.
__init__
def __init__(owner: Subscription,
*,
backend: Backend | str | None = None,
raw: bool = False)read
async def read() -> SubscriptionDeliveryRead one delivery; cancellation leaves its native receipt unread.
unsubscribe
async def unsubscribe(
drain: bool = False) -> list[SubscriptionDelivery] | NoneClose the shared subscription, optionally returning marked batches.
Failed conversion or canceled publication leaves the frozen drain available to another unsubscribe(drain=True) call, even after close. A non-draining close intentionally discards any retained drain.
close
async def close() -> NoneClose the shared subscription without draining.
aclose
async def aclose() -> NoneClose this async iterator and its shared subscription.
subscription_feeds
def subscription_feeds() -> list[dict[str, Any]]Return retained upstream feeds for the active engine.
Each row contains service, topic, options (list), fields (union list), consumers, delayed (bool or None), state, isolated, and field_errors (field-to-category dict). Closed feeds leave the registry; this is a current snapshot, not an event history.
asubscribe
async def asubscribe(
tickers: str | list[str],
fields: str | list[str],
*,
raw: bool = False,
all_fields: bool = False,
backend: Backend | str | None = None,
service: str | Service | None = None,
options: list[str] | None = None,
conflate: bool = False,
tick_mode: bool = False,
flush_threshold: int | None = None,
stream_capacity: int | None = None,
overflow_policy: str | None = None,
delivery: str = "deltas",
output: str | None = None,
aliases: Mapping[str, str] | None = None,
on_delayed: str = "warn",
isolated: bool = False,
rows: bool = True,
on_field_error: str = "warn",
zero_as_null: Sequence[str] | None = None) -> SubscriptionCreate an async subscription to real-time market data.
This is the low-level subscription API with full control over the subscription lifecycle, including dynamic add/remove.
Subscription recovery is handled automatically by the Bloomberg SDK (see BLPAPI ChangeLog v3.11.6); per-subscription availability transitions fire as SubscriptionStreamsActivated / SubscriptionStreamsDeactivated events available in sub.events.
Dict ticks are sparse deltas: missing keys are unchanged, while present None values explicitly clear fields. Arrow batches append the binary __xbbg_present bitset (LSB-first; bit i maps to schema field i + 2). Strict delta consumers raise BlpSubscriptionDataLossError on Bloomberg DATALOSS or local queue loss. Opt-in overflow_policy="drop_oldest" retains newer deltas and reports local gaps through sub.deliveries(); SDK loss remains terminal. State and image-only (rows=False) consumers recover from DATALOSS with a fresh paint; sub.events records DataLoss/FeedRecovered. State rows are invalid until that paint completes. Session termination does not auto-recover. Connection-down notifications alone remain nonterminal.
Market-data feeds are shared within an engine by default. A late row consumer receives a projected image. Field-union repaints reach waiting consumers in full; existing consumers receive only changed projected values and clears. Filtered streams omit rows with none of their data fields. all_fields=True also exposes scalar fields induced by other consumers. Other services are always isolated and keep their service-specific semantics.
Arguments:
tickers- Securities to subscribe tofields- Fields to subscribe to (e.g., 'LAST_PRICE', 'BID', 'ASK')raw- If True, yield raw ArrowRecordBatch wrappers for max performanceall_fields- Expose all top-level scalar Bloomberg fields. Unrequested arrays/complex fields are omitted; requested unsupported shapes fail.backend- Explicit backend for batch conversion.None(the default) yields native ArrowTable wrappers; pass e.g. "narwhals", "pandas", or "pyarrow" to opt into conversion. Ignored if raw=True.service- Bloomberg service (e.g., '//blp/mktdata'). For BPS services such as//blp/mktbarand//blp/mktvwap, tickers are normalized to explicit service topics.options- List of Bloomberg subscription options.conflate- If True, request Bloomberg conflated market data for //blp/mktdata. Quote updates are conflated by Bloomberg; trades are still delivered as received.tick_mode- If True, return native dict ticks without building Arrow (implies raw=True)flush_threshold- Maximum number of already-queued updates combined into one batch (engine default 16). A read never waits for more updates, so a quiet stream still yields one-row batches.stream_capacity- Backpressure capacity of the native subscription stream.overflow_policy-"drop_newest"(default) fails on a full consumer buffer;"block"waits briefly on a bounded forwarder and fails on overflow/timeout. Neither waits on Bloomberg's callback thread."drop_oldest"evicts the oldest buffered updates and requiressub.deliveries()so local loss cannot be silently discarded.delivery-"deltas"preserves sparse update semantics (default)."state"conflates current images and must be consumed throughsub.deliveries(); each row includesvalid. State mode rejectsrows=Falseand explicit raw queue controls.output- Output selector:"record_batch","backend","dict", or"tick"(case-insensitive). When provided, it takes precedence overrawandtick_mode;Noneretains their behavior.aliases- Bloomberg topic to consumer label mapping. Labels replace topics in rows, status,tickers, andremove.on_delayed-"warn"emits one BlpDelayedDataWarning per topic;"raise"rejects only that topic;"ignore"records the flag without a warning.isolated- If True, use private feeds and a dedicated subscription session.rows- If False, maintain an image without queuing rows. Iteration raises RuntimeError; readlatest()instead. Image-only consumers cannot overflow a row queue.on_field_error-"warn"emits BlpFieldWarning for rejected explicit fields;"raise"rejects the affected topic;"ignore"recordsfield_errorswithout warnings.zero_as_null- Field names whose numeric zero values become null inlatest()and state deliveries. Delta rows and stored images are unchanged.
Returns:
Subscription handle for iteration and control
Example:
# Basic usage: yields native xbbg.ArrowTable wrappers by default
sub = await xbbg.asubscribe(["AAPL US Equity"], ["LAST_PRICE", "BID"])
async for table in sub:
print(table.to_pylist())
await sub.unsubscribe()
# With context manager
async with xbbg.asubscribe(["AAPL US Equity"], ["LAST_PRICE"]) as sub:
count = 0
async for batch in sub:
print(batch)
count += 1
if count >= 10:
break
# Dynamic add/remove
sub = await xbbg.asubscribe(["AAPL US Equity"], ["LAST_PRICE"])
async for batch in sub:
if should_add_msft:
await sub.add(["MSFT US Equity"])
if should_remove_aapl:
await sub.remove(["AAPL US Equity"])
# Tick mode (dict conversion)
sub = await xbbg.asubscribe(["AAPL US Equity"], ["LAST_PRICE"], tick_mode=True)
async for tick_dict in sub:
print(tick_dict) # {'ticker': 'AAPL US Equity', 'LAST_PRICE': 150.25, ...}subscribe
def subscribe(tickers: str | list[str],
fields: str | list[str],
*,
raw: bool = False,
all_fields: bool = False,
backend: Backend | str | None = None,
service: str | Service | None = None,
options: list[str] | None = None,
conflate: bool = False,
tick_mode: bool = False,
flush_threshold: int | None = None,
stream_capacity: int | None = None,
overflow_policy: str | None = None,
delivery: str = "deltas",
output: str | None = None,
aliases: Mapping[str, str] | None = None,
on_delayed: str = "warn",
isolated: bool = False,
rows: bool = True,
on_field_error: str = "warn",
zero_as_null: Sequence[str] | None = None) -> SubscriptionSync subscription creation. See asubscribe for details.
astream
async def astream(tickers: str | list[str],
fields: str | list[str],
*,
raw: bool = False,
all_fields: bool = False,
backend: Backend | str | None = None,
callback: Callable[[Any], None] | None = None,
tick_mode: bool = False,
conflate: bool = False,
flush_threshold: int | None = None,
stream_capacity: int | None = None,
overflow_policy: str | None = None,
delivery: str = "deltas",
aliases: Mapping[str, str] | None = None,
on_delayed: str = "warn",
isolated: bool = False,
on_field_error: str = "warn",
zero_as_null: Sequence[str] | None = None)High-level async streaming - simple iteration.
This is the simple API for streaming data. For dynamic add/remove, use asubscribe() instead.
Arguments:
tickers- Securities to subscribe tofields- Fields to subscribe toraw- If True, yield raw Arrow RecordBatchesall_fields- If True, expose all top-level scalar Bloomberg subscription fieldsbackend- DataFrame backend for batch conversioncallback- Optional callback function to invoke on each batchtick_mode- If True, convert batches to dictsconflate- If True, request Bloomberg conflated market data for //blp/mktdata.flush_threshold- Maximum number of already-queued updates combined into one batch (engine default 16). A read never waits for more updates.stream_capacity- Capacity of the native subscription stream.overflow_policy-"drop_newest"(default) and"block"preserve strict delta output."drop_oldest"yields marked batch envelopes.delivery-"state"yields :class:SubscriptionDeliveryenvelopes, as does an effective drop-oldest policy (including global defaults). Theirdatauses batchraw/backendsettings independently oftick_mode; continuity information is never discarded.aliases- Bloomberg topic to consumer label mapping.on_delayed-"warn"(default),"raise"(reject delayed topics), or"ignore"(flag only).isolated- Use private feeds instead of sharing market-data subscriptions.on_field_error- Rejected-field policy:"warn","raise", or"ignore".zero_as_null- Fields whose numeric zeros become null inlatest()and state deliveries; delta rows retain their original values.
Yields:
Legacy strict batches/ticks, or marked SubscriptionDelivery envelopes.
Example:
async for batch in xbbg.astream(["AAPL US Equity"], ["LAST_PRICE"]):
print(batch)
if done:
break
# With callback
def on_batch(batch):
print(f"Got batch: {batch}")
async for _ in xbbg.astream(["AAPL US Equity"], ["LAST_PRICE"], callback=on_batch):
passstream
def stream(tickers: str | list[str],
fields: str | list[str],
*,
raw: bool = False,
all_fields: bool = False,
backend: Backend | str | None = None,
callback: Callable[[Any], None] | None = None,
tick_mode: bool = False,
conflate: bool = False,
flush_threshold: int | None = None,
stream_capacity: int | None = None,
overflow_policy: str | None = None,
delivery: str = "deltas",
aliases: Mapping[str, str] | None = None,
on_delayed: str = "warn",
isolated: bool = False,
on_field_error: str = "warn",
zero_as_null: Sequence[str] | None = None)High-level sync streaming using the managed background event loop.
Use astream() directly from async contexts.
New pool-session claims wait at most five seconds before raising the producer limit RuntimeError. Joining existing shared feeds needs no session claim and never waits for capacity. There is no separate Python producer counter.
Arguments:
tickers- Securities to subscribe tofields- Fields to subscribe toraw- If True, yield raw Arrow RecordBatchesall_fields- If True, expose all top-level scalar Bloomberg subscription fieldsbackend- DataFrame backend for batch conversioncallback- Optional callback function to invoke on each batchtick_mode- If True, convert batches to dictsconflate- If True, request Bloomberg conflated market data for //blp/mktdata.flush_threshold- Maximum number of already-queued updates combined into one batch (engine default 16). A read never waits for more updates.stream_capacity- Capacity of both the native subscription stream and the sync bridge. Defaults to 256.overflow_policy-"drop_newest"(default) and"block"preserve strict delta output."drop_oldest"yields marked batch envelopes.delivery-"state"yields :class:SubscriptionDeliveryenvelopes, as does an effective drop-oldest policy (including global defaults). Theirdatauses batchraw/backendsettings independently oftick_mode; continuity information is never discarded.aliases- Bloomberg topic to consumer label mapping.on_delayed-"warn"(default),"raise"(reject delayed topics), or"ignore"(flag only).isolated- Use private feeds instead of sharing market-data subscriptions.on_field_error- Rejected-field policy:"warn","raise", or"ignore".zero_as_null- Fields whose numeric zeros become null inlatest()and state deliveries; delta rows retain their original values.
Yields:
Legacy strict batches/ticks, or marked SubscriptionDelivery envelopes.
Example:
for batch in xbbg.stream(["AAPL US Equity"], ["LAST_PRICE"]):
print(batch)
if done:
breakavwap
async def avwap(tickers: str | list[str],
*,
start_time: str | None = None,
end_time: str | None = None,
raw: bool = False,
all_fields: bool = True,
backend: Backend | str | None = None,
delivery: str = "deltas") -> SubscriptionSubscribe to real-time VWAP data.
Uses Bloomberg's //blp/mktvwap service. Bloomberg requires explicit Market VWAP topics (for example, //blp/mktvwap/ticker/IBM US Equity) and VWAP as the single requested field. Security identifiers passed here are normalized to those explicit topics.
Arguments:
tickers- Security identifier(s). Plain tickers use thetickertopic type; already-qualified//blp/mktvwap/...topics pass through unchanged.start_time- Optional VWAP calculation start time (e.g., "09:30").end_time- Optional VWAP calculation end time (e.g., "16:00").raw- If True, yield raw Arrow RecordBatches for max performance.all_fields- If True, expose the full top-level VWAP payload.backend- DataFrame backend for batch conversion (ignored if raw=True).
Returns:
Subscription handle for iteration and control.
Example:
# Basic usage - subscribe to VWAP
sub = await xbbg.avwap("IBM US Equity")
async for batch in sub:
print(batch)
await sub.unsubscribe()
# With custom time window
sub = await xbbg.avwap(["IBM US Equity", "MSFT US Equity"], start_time="09:30", end_time="16:00")vwap
def vwap(tickers: str | list[str],
*,
start_time: str | None = None,
end_time: str | None = None,
raw: bool = False,
all_fields: bool = True,
backend: Backend | str | None = None,
delivery: str = "deltas") -> SubscriptionSync VWAP subscription creation. See avwap for details.
amktbar
async def amktbar(tickers: str | list[str],
*,
bar_size: int = 1,
start_time: str | None = None,
end_time: str | None = None,
raw: bool = False,
all_fields: bool = True,
backend: Backend | str | None = None,
delivery: str = "deltas") -> SubscriptionSubscribe to real-time streaming OHLC bars.
Uses Bloomberg's //blp/mktbar service. Bloomberg requires explicit market-bar topics (for example, //blp/mktbar/ticker/ES1 Index), LAST_PRICE as the only requested field, and bar_size as the bar interval option. Security identifiers passed here are normalized to those explicit topics.
Arguments:
tickers- Security identifier(s). Plain tickers use thetickertopic type; identifiers like/figi/...keep their identifier type.bar_size- Bar interval in minutes (default: 1).start_time- Optional start time in HH:MM format.end_time- Optional end time in HH:MM format.raw- If True, return raw xbbg ArrowRecordBatch (default: False).all_fields- If True, expose the full top-level market-bar payload.backend- DataFrame backend to return. If None, uses global default.
Returns:
Subscription object for async iteration.
Example:
# Subscribe to 5-minute bars
async with await amktbar("AAPL US Equity", bar_size=5) as sub:
async for batch in sub:
print(batch)
# Multiple securities
sub = await amktbar(["AAPL US Equity", "MSFT US Equity"], bar_size=1)
async for batch in sub:
print(batch)mktbar
def mktbar(tickers: str | list[str],
*,
bar_size: int = 1,
start_time: str | None = None,
end_time: str | None = None,
raw: bool = False,
all_fields: bool = True,
backend: Backend | str | None = None,
delivery: str = "deltas") -> SubscriptionSync market-bar subscription creation. See amktbar for details.
adepth
async def adepth(tickers: str | list[str],
*,
raw: bool = False,
all_fields: bool = False,
backend: Backend | str | None = None,
delivery: str = "deltas") -> SubscriptionSubscribe to Level 2 market depth / order book data.
.. warning:: Requires a Bloomberg B-PIPE environment and applicable service entitlements. This feature is not available with Terminal-only connections.
Provides real-time order book updates with bid/ask prices and sizes at multiple levels.
Arguments:
tickers- Security identifier(s).raw- If True, return raw xbbg ArrowRecordBatch (default: False).all_fields- If True, expose all top-level scalar Bloomberg subscription fieldsbackend- DataFrame backend to return. If None, uses global default.
Returns:
Subscription object for async iteration.
Raises:
BlpBPipeError- If a B-PIPE environment or service entitlement is unavailable.
Example:
# Subscribe to market depth
async with await adepth("AAPL US Equity") as sub:
async for batch in sub:
print(batch) # Order book updatesdepth
def depth(tickers: str | list[str],
*,
raw: bool = False,
all_fields: bool = False,
backend: Backend | str | None = None,
delivery: str = "deltas") -> SubscriptionSync market-depth subscription creation. See adepth for details.
achains
async def achains(underlying: str,
*,
chain_type: str = "OPTIONS",
raw: bool = False,
all_fields: bool = False,
backend: Backend | str | None = None,
delivery: str = "deltas") -> SubscriptionSubscribe to option or futures chain updates.
.. warning:: Requires a Bloomberg B-PIPE environment and applicable service entitlements. This feature is not available with Terminal-only connections.
Provides real-time updates for option chains or futures chains on a given underlying security.
Arguments:
underlying- Underlying security identifier.chain_type- Type of chain - "OPTIONS" or "FUTURES" (default: "OPTIONS").raw- If True, return raw xbbg ArrowRecordBatch (default: False).all_fields- If True, expose all top-level scalar Bloomberg subscription fieldsbackend- DataFrame backend to return. If None, uses global default.
Returns:
Subscription object for async iteration.
Raises:
BlpBPipeError- If a B-PIPE environment or service entitlement is unavailable.
Example:
# Subscribe to option chain
async with await achains("AAPL US Equity") as sub:
async for batch in sub:
print(batch) # Option chain updates
# Subscribe to futures chain
sub = await achains("ES1 Index", chain_type="FUTURES")chains
def chains(underlying: str,
*,
chain_type: str = "OPTIONS",
raw: bool = False,
all_fields: bool = False,
backend: Backend | str | None = None,
delivery: str = "deltas") -> SubscriptionSync chain subscription creation. See achains for details.
abta
async def abta(tickers: str | list[str],
study: str,
*,
start_date: str | None = None,
end_date: str | None = None,
periodicity: str = "DAILY",
interval: int | None = None,
**study_params) -> DataFrameResultGet technical analysis study data (async).
Uses Bloomberg //blp/tasvc service to calculate technical indicators.
Arguments:
tickers- Security or list of securitiesstudy- Study type (e.g., 'sma', 'rsi', 'macd', 'boll', 'atr')start_date- Start date. Accepts ISO 8601 /YYYYMMDDstring,datetime.date,datetime.datetime, orpd.Timestamp.end_date- End date. Same accepted shapes asstart_date.periodicity- Data periodicity ('DAILY', 'WEEKLY', 'MONTHLY', 'INTRADAY')interval- Intraday interval in minutes (only for periodicity='INTRADAY')**study_params- Study-specific parameters (e.g., period=20 for SMA period)
Returns:
DataFrame with study results
Available Studies: Moving Averages: sma, ema, wma, vma, tma
Oscillators- rsi, macd, mao, momentum, rocBands- boll (Bollinger), keltner, maeTrend- dmi/adx, stoch, trender, parabolic/sarVolume- chko, ado, vatVolatility- atr, hurstOther- ichimoku, pivot, williams
Example:
# Simple Moving Average with 20-day period
df = await xbbg.abta("AAPL US Equity", "sma", period=20)
# RSI with 14-day period
df = await xbbg.abta("AAPL US Equity", "rsi", period=14)
# MACD with custom parameters
df = await xbbg.abta("AAPL US Equity", "macd", maPeriod1=12, maPeriod2=26, sigPeriod=9)
# Bollinger Bands with 20-day period and 2 std devs
df = await xbbg.abta("AAPL US Equity", "boll", period=20, upperBand=2.0, lowerBand=2.0)
# Intraday RSI with 60-minute bars
df = await xbbg.abta("AAPL US Equity", "rsi", periodicity="INTRADAY", interval=60)
# Multiple securities (sends concurrent requests)
df = await xbbg.abta(["AAPL US Equity", "MSFT US Equity"], "rsi")bta
def bta(tickers: str | list[str],
study: str,
*,
start_date: str | None = None,
end_date: str | None = None,
periodicity: str = "DAILY",
interval: int | None = None,
**study_params) -> DataFrameResultSync technical analysis request. See abta for details.
ta_studies
def ta_studies() -> list[str]List available technical analysis study names.
Returns:
List of study short names that can be used with bta()/abta()
Example:
>>> xbbg.ta_studies()
['sma', 'ema', 'rsi', 'macd', 'boll', 'atr', ...]ta_study_params
def ta_study_params(study: str) -> dict[str, Any]Get default parameters for a technical analysis study.
Arguments:
study- Study name (e.g., 'rsi', 'macd', 'boll')
Returns:
Dictionary of parameter names and their default values
Example:
>>> xbbg.ta_study_params('rsi')
{'period': 14, 'priceSourceClose': 'PX_LAST'}
>>> xbbg.ta_study_params('macd')
{'maPeriod1': 12, 'maPeriod2': 26, 'sigPeriod': 9, 'priceSourceClose': 'PX_LAST'}
>>> xbbg.ta_study_params('boll')
{'period': 20, 'upperBand': 2.0, 'lowerBand': 2.0, 'priceSourceClose': 'PX_LAST'}generate_ta_stubs
def generate_ta_stubs(output_dir: str | None = None) -> strGenerate Python type stubs for technical analysis studies.
Creates a .pyi file with TypedDict definitions for all TA study parameters. Stubs are generated from the //blp/tasvc schema for IDE autocomplete support.
Arguments:
output_dir- Output directory (default: ~/.xbbg/stubs/)
Returns:
Path to the generated stub file.
Example:
>>> xbbg.generate_ta_stubs()
'~/.xbbg/stubs/ta_studies.pyi'
# Then in your code, IDE will autocomplete:
>>> from xbbg.stubs.ta_studies import RSIParams
>>> params: RSIParams = {'period': 14}configure
def configure(config=None, **kwargs) -> NoneConfigure the xbbg engine before first use.
This function must be called before any Bloomberg request is made. If called after the engine has started, the existing engine is shut down and will restart with the new config on next use.
Can be called with an EngineConfig object, keyword arguments, or both (kwargs override config fields). All defaults come from Rust.
See EngineConfig() for available fields and their defaults:
>>> from xbbg import EngineConfig
>>> EngineConfig()
EngineConfig(host='localhost', port=8194, request_pool_size=2,
subscription_pool_size=1, ...)Arguments:
config- An EngineConfig object with all settings.**kwargs- Override individual fields (host, port, request_pool_size, subscription_pool_size, runtime_worker_threads, max_subscription_sessions, shard_requests, shard_threshold, shard_chunk_size, shard_max_concurrent, field_cache_path, bql_app_name, auth_method, app_name, user_id, ip_address, token, etc.).bql_app_nameis an optional BQLclientContext.appNamedefault, independent of the authentication-onlyapp_name. Per-call BQLapp_namevalues override it; when it is None and no per-call value is supplied, the request element is omitted. The closed string fields arevalidation_mode("disabled"(default),"lenient", or"strict"),overflow_policy("drop_newest"(default) or"block"),sdk_log_level("off"(default),"fatal","error","warn","info","debug", or"trace"), andkey_column, the name of the result column holding each row's security:"ticker"(default, deprecated; results that use it emit aFutureWarning) or"security", which becomes the default in the next major release.tls_client_credentialsandtls_trust_materialaccept file paths asstror in-memory DER material asbytes(PKCS#12 credentials and PKCS#7 trust). Supply both, using the same representation; byte material is never written to temporary files.
Raises:
TypeError- If an unknown keyword argument is passed.ValueError- Ifnum_start_attemptsis less than 1.RuntimeWarning- If called after the engine has already started (the existing engine is shut down and will restart with the new config).
Example:
import xbbg
# Option 1: Using keyword arguments (most common)
xbbg.configure(request_pool_size=4, subscription_pool_size=2)
# Opt-in sharding for wide multi-security BDP/BDH requests
xbbg.configure(
request_pool_size=6,
shard_requests=True,
shard_threshold=20,
shard_chunk_size=16,
shard_max_concurrent=4,
)
# Option 2: Using EngineConfig object
from xbbg import EngineConfig
xbbg.configure(EngineConfig(request_pool_size=4))
# Option 3: EngineConfig + overrides
cfg = EngineConfig(request_pool_size=4)
xbbg.configure(cfg, subscription_pool_size=2)
# Option 4: Default BQL application context (not authentication)
xbbg.configure(bql_app_name="example-bql-app")
# Option 5: B-PIPE / SAPI authentication
xbbg.configure(
host="bpipe-host",
port=8195,
auth_method="manual",
app_name="my-app",
user_id="123456",
ip_address="10.0.0.1",
num_start_attempts=5,
auto_restart_on_disconnection=False,
)
# Option 6: Custom field cache location
xbbg.configure(field_cache_path="/data/bloomberg/field_cache.json")set_backend
def set_backend(backend: Backend | str | None) -> NoneSet the default output backend, or None for automatic selection.
Optional backends are checked before changing the session default. The setting applies to both request endpoints and extension recipes.
get_backend
def get_backend() -> Backend | NoneGet the configured session default, or None for automatic selection.
OverrideSpec Objects
@dataclass(frozen=True)
class OverrideSpec(Mapping[str, str])pairs
Type: tuple[tuple[str, str], ...]
security_pairs
Type: tuple[tuple[str, tuple[tuple[str, str], ...]], ...]
items
def items()to_pairs
def to_pairs() -> list[tuple[str, str]]to_dict
def to_dict() -> dict[str, str]to_security_pairs
def to_security_pairs() -> list[tuple[str, list[tuple[str, str]]]]for_security
def for_security(security: str, *sources: Any, **kwargs: Any) -> OverrideSpecovr
def ovr(*sources: Any, **kwargs: Any) -> OverrideSpecRequestEnvironment Objects
@dataclass(frozen=True, slots=True)
class RequestEnvironment()Read-only engine and auth snapshot available to request middleware.
source
Type: str
host
Type: str | None
port
Type: int | None
servers
Type: tuple[tuple[str, int], ...]
zfp_remote
Type: str | None
auth_method
Type: str | None
app_name
Type: str | None
user_id
Type: str | None
validation_mode
Type: str | None
RequestContext Objects
@dataclass(slots=True)
class RequestContext()Mutable context object passed through the request middleware chain.
request_id
Type: str
params
Type: RequestParams
backend
Type: Backend | str | None
raw
Type: bool
securities
Type: list[str]
fields
Type: list[str]
environment
Type: RequestEnvironment
metadata
Type: dict[str, Any]
started_at
Type: float
elapsed_ms
Type: float | None
batch
Type: Any | None
table
Type: Any | None
frame
Type: DataFrameResult | None
error
Type: Exception | None
field_type_default
Type: str | None
to_dispatch_dict
def to_dispatch_dict() -> dict[str, Any]Materialize the current request state immediately before engine dispatch.
add_middleware
def add_middleware(middleware: RequestMiddleware) -> RequestMiddlewareRegister a request middleware callable.
Middleware is called as middleware(context, call_next) and may be sync or async. Returning the middleware makes this usable as a decorator.
remove_middleware
def remove_middleware(middleware: RequestMiddleware) -> NoneRemove a previously registered middleware callable.
clear_middleware
def clear_middleware() -> NoneRemove all registered middleware.
get_middleware
def get_middleware() -> tuple[RequestMiddleware, ...]Return the currently registered middleware chain.
set_middleware
def set_middleware(middleware: Sequence[RequestMiddleware]) -> NoneReplace the current middleware chain.
Service
Re-exported from xbbg.services.Service.
Operation
Re-exported from xbbg.services.Operation.
OutputMode
Re-exported from xbbg.services.OutputMode.
RequestParams
Re-exported from xbbg.services.RequestParams.
ExtractorHint
Re-exported from xbbg.services.ExtractorHint.
abops
async def abops(service: str | Service = Service.REFDATA) -> list[str]List available operations for a Bloomberg service (async).
Arguments:
service- Service URI or Service enum (default: //blp/refdata)
Returns:
List of operation names.
Example:
>>> ops = await abops()
>>> print(ops)
['ReferenceDataRequest', 'HistoricalDataRequest', ...]
>>> ops = await abops("//blp/instruments")
>>> print(ops)
['InstrumentListRequest', ...]bops
def bops(service: str | Service = Service.REFDATA) -> list[str]Sync service operation listing. See abops for details.
abschema
async def abschema(service: str | Service = Service.REFDATA,
operation: str | Operation | None = None) -> dictGet Bloomberg service or operation schema (async).
Returns introspected schema with element definitions, types, and enum values. Schemas are cached locally (~/.xbbg/schemas/) for fast subsequent access.
Arguments:
service- Service URI or Service enum (default: //blp/refdata)operation- Optional operation name. If None, returns full service schema.
Returns:
Dictionary with schema information:
- If operation is None: Full service schema with all operations
- If operation is specified: Just that operation's request/response schema
Example:
>>> # Get full service schema
>>> schema = await abschema()
>>> print(schema['operations'][0]['name'])
'ReferenceDataRequest'
>>> # Get specific operation schema
>>> op_schema = await abschema(operation="ReferenceDataRequest")
>>> print(op_schema['request']['children'][0]['name'])
'securities'
>>> # Get enum values for an element
>>> op = await abschema(operation="HistoricalDataRequest")
>>> for child in op['request']['children']:
... if child.get('enum_values'):
... print(f"{child['name']}: {child['enum_values']}")bschema
def bschema(service: str | Service = Service.REFDATA,
operation: str | Operation | None = None) -> dictSync service schema lookup. See abschema for details.
