I am very new with python, and I am used to work with bloomberg formulas for excel. I am starting to use a lot more python in my analysis, is there any library that performs same functions as bdp, bdh or bcurve? Thanks! Juan

  • 1
    $\begingroup$ You can't use BCurve or any other DLIB functions in python. Not even in Bloomberg BQNT environment. A good alternative would be to use QuantLib. You can build curves and value instruments just like DLIB. $\endgroup$ Jun 2, 2020 at 9:59
  • $\begingroup$ Bcurve is actually part of the curves toolkit (CTK) which is not related to DLIB. That said, the above comment is still correct. CTK, the swaps toolkit (STK) and the derivatives toolkit (DTK), cannot be used with blpapi (only premium data offerings would allow you to do this). $\endgroup$
    – AKdemy
    May 29, 2021 at 12:31

4 Answers 4


I have experimented with various choices quite a bit.

My advice is to use vanilla blpapi . There are many good examples in the git repository. Some helpful installation notes are also here .

There are packages built on top, such as pdblp that, in my opinion, are very good but not required by most people.


blpapi as mentioned it worth learning for sure. In addition to it, if you are looking to work with Pandas I would suggest using TIA: https://github.com/bpsmith/tia

At the moment, TIA is only compatible with Python 2, but here https://github.com/bpsmith/tia/issues/11 has a Python 3 conversion. I've been using this recently and it's pretty good. An example:

from tia.bbg import LocalTerminal
import tia.bbg.datamgr as dm
import datetime

event = 'TRADE'
dt = pd.datetools.BDay(-1).apply(pd.datetime.now())
start = pd.datetime.combine(dt, datetime.time(13, 30))
end = pd.datetime.combine(dt, datetime.time(21, 30))
f = LocalTerminal.get_intraday_bar(sid, event, start, end, 

      close     high    low   numEvents   open      time                value   volume
0   162.2500    162.70  161.51  4005    162.4900    2015-02-24 14:30:00  110345672  680888

The github link above has loads of examples, too.


I normally use pybbg which is also a wrapper for blpapi.

With a logged in Bloomberg session, just import it and start a connection

import pybbg as pybbg
bbg = pybbg.Pybbg()

Then you can use bdp, bdh, bds and bdih.


bbg.bdp('PGB 1.95 06/15/2029 Govt', ['MATURITY', 'COUPON', 'ISSUE_DT', 'YLD_YTM_MID'])

enter image description here

You can even query deals from SWPM...

pd.options.display.float_format = '{:,.2f}'.format
bbg.bdp('SLPA2EZJ Corp', flds)

enter image description here

...and provide overrides

overrides = {'SW_CURVE_DT': '20190507'}
bbg.bdp('SLPA2EZJ Corp', flds, overrides)

enter image description here


bbg.bdh('EUR Curncy', 'PX_LAST', '20200525')

enter image description here


bbg.bds('YCSW0045 Index', 'CURVE_TENOR_RATES')

enter image description here


from datetime import  datetime
flds = ['close', 'high', 'low', 'open']
ticker = 'PGB 1.95 06/15/2029 Govt'
bbg.bdib(ticker, flds, datetime(2020,6,1,15,0), datetime(2020,6,1,15,30), eventType='ASK', interval = 5)

enter image description here


Ask your Bloomberg rep to enable you for BQNT access. They will push a Python instance to your machine and you can go to the terminal and run BQNT

You will get a Jupyter environment that can use Bloomberg data


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.