Repository navigation
xbbg 0.12.0
Added
- Async-first architecture: All Bloomberg API functions (
bdp,bds,bdh,bdib,bdtick,bql,beqs,bsrch,bqr,bta) now have async counterparts (abdp,abds,abdh, etc.) as the source of truth; sync wrappers delegate via_run_sync()(#218) - Bond analytics module (
xbbg.ext.bonds): 6 new functions for fixed income analytics --bond_info(reference metadata and ratings),bond_risk(duration, convexity, DV01),bond_spreads(OAS, Z-spread, I-spread, ASW),bond_cashflows(cash flow schedule),bond_key_rates(key rate durations and risks),bond_curve(multi-bond relative value comparison) - Options analytics module (
xbbg.ext.options): 6 new functions and 5 enums for equity option analytics --option_info(contract metadata),option_greeks(Greeks and implied volatility),option_pricing(value decomposition and activity),option_chain(chain viaCHAIN_TICKERSwith overrides),option_chain_bql(chain via BQL with rich filtering),option_screen(multi-option comparison). Enums:PutCall,ChainPeriodicity,StrikeRef,ExerciseType,ExpiryMatch - CDX analytics (
xbbg.ext.cdx): 8 new functions for credit default swap index analytics --cdx_info,cdx_defaults,cdx_pricing,cdx_risk,cdx_basis,cdx_default_prob,cdx_cashflows,cdx_curve.cdx_pricing/cdx_risksupportCDS_RRrecovery rate override YieldTypeexpanded: AddedYTW(Yield to Worst),YTP(Yield to Put),CFY(Cash Flow Yield) toYieldTypeenumworkout_dtparameter foryas(): Workout date for yield-to-worst/call calculations, maps toYAS_WORKOUT_DTBloomberg override. Acceptsstr(YYYYMMDD) ordatetimetzparameter forbdib()/abdib(): Controls output timezone for intraday bar data. Defaults toNone(exchange local timezone, matching v0.7.x behavior). Settz='UTC'to keep UTC timestamps, or pass any IANA timezone string (e.g.,'Europe/London')exchange_tz()helper: Returns the IANA timezone string for any Bloomberg ticker (e.g.,blp.exchange_tz('AAPL US Equity')->'America/New_York'). Exported viablp.exchange_tz()- LONG_TYPED output format: New
_to_long_typed()function produces typed value columns (value_f64,value_i64,value_str,value_bool,value_date,value_ts) with exactly one populated per row based on the Arrow type of each field - LONG_WITH_METADATA output format: New
_to_long_with_metadata()function produces(ticker, date, field, value, dtype)wherevalueis stringified anddtypecontains the Arrow type name (e.g.double,int64,string) - CI non-ASCII source check: New
auto_ci.ymlstep rejects non-ASCII characters in Python source files (allows CJK for ticker tests) - Comprehensive test coverage: 55+ new tests including bond analytics (7), CDX analytics (8), options analytics, timezone conversion (13),
ovrdsdict normalization (7),_events_to_table()(16),bdtickformat variants (5), mixed-type BDP (2), and output format tests (12)
Changed
- Unified I/O layer: All Bloomberg requests now flow through a single
arequest()async entry point inconn.py, replacing scattered session/service management across modules (#218) - Futures resolution uses
FUT_CHAIN_LAST_TRADE_DATES(#223): Replaced manual candidate generation (FUT_GEN_MONTH+ batchbdp) with Bloomberg-nativeFUT_CHAIN_LAST_TRADE_DATESvia singlebds()call. ~2x faster (0.25-0.30s vs 0.53-0.72s) sync_apidecorator: Replaces 13 hand-written sync wrappers across API modules (screening.py,historical.py,intraday.py, etc.) with a singlesync_api(async_fn)call- Table-driven deprecation wrappers: 23 manual wrapper functions in
blp.pyreplaced by dict + loop pattern; 24warn_*functions indeprecation.pyreplaced by_DEPRECATION_REGISTRY+get_warn_func()lookup - Market session rules extracted to TOML (
markets/config/sessions.toml): All MIC and exchange code rules moved fromsessions.pyinto data-driven TOML config, reducingsessions.pyfrom 364 to 168 lines (54% reduction) - Pipeline factory registry (
pipeline_factories.py): Centralized factory dispatch replaces scattered conditionals - CDX ticker format corrected: Version is now a separate space-delimited token (e.g.,
CDX HY CDSI S45 V2 5Y Corpinstead ofS45V2) tomliconditional dependency added:tomli>=2.0.1for Python < 3.11 (TOML parsing forsessions.toml)- Net reduction of ~1,346 lines across 27 files from codegen and table-driven optimizations
Removed
xbbg/io/db.py: SQLite database helper module (zero imports across codebase) (#218)xbbg/io/param.py: Legacy parameter/configuration module (zero imports across codebase) (#218)xbbg/io/files.py: File path utility module (zero imports after replacing 6 usages incache.pyandconst.pywithpathlib.Path) (#218)regression_testing/: Standalone v0.7.7 regression test directory; all scenarios covered bytest_live_endpoints.py(#218)MONTH_CODE_MAPand futures candidate generation helpers: Superseded byFUT_CHAIN_LAST_TRADE_DATESchain resolution (#223)- Stale files:
pmc_cache.json,xone.db, empty__init__files,test_param.py(#218)
Fixed
bdtickformat parameter was completely non-functional: All five output formats (LONG, SEMI_LONG, WIDE, LONG_TYPED, LONG_WITH_METADATA) were broken due to MultiIndex column wrapping, killed index name, and mixed-type Arrow conversion errorsbdibtimezone regression: The Arrow pipeline rewrite (v0.11.0) dropped the UTC-to-exchange local timezone conversion that existed in v0.7.x. Restored with configurabletzparameterArrowInvalidon multi-field BDP calls: Bloomberg returns different Python types for different fields. New_events_to_table()builds Arrow tables with automatic type coercion fallback (#219)create_requestcrashed whenovrdspassed as dict: Now normalizes dict to list of tuples before iteration (SO#79880156)- Case-sensitive
backendandformatparameters: Added_missing_classmethod toBackendandFormatenums for case-insensitive lookup (#221) - Mock session leak in tests: Added autouse
_reset_session_managerfixture to preventMagicMockpersistence across test modules (#213) intervalparameter leaked as Bloomberg override: Added toPRSV_COLSso it stays local (#145)StrEnumPython 3.10 compatibility: Added polyfill for Python < 3.11- Non-ASCII characters in source: Replaced with ASCII equivalents for CI compliance
Security
- Bump
cryptographyfrom 46.0.4 to 46.0.5: Fixes CVE-2026-26007 (#217)
Full Changelog: v0.11.4...v0.12.0