Has anyone found away to call Bloomberg BQL API using Pdblp or another package with Python?
Asked Answered
G

3

8

The BQL works in Excel using what appears to be the same API add-in using the same fields to call the Bloomberg data, i.e PX_LAST. I currently run models in python using pdblp, that works great and I would love to move to the BQL version of the API to optimize data usage outside of the terminal. Is anyone aware of any effort to utilize the BQL in any package? I know someone asked about this last year... looking for an update.

Gabrielagabriele answered 8/7, 2020 at 22:57 Comment(0)
P
2

Quite old but maybe someone comes along this thread... I talked to BBG recently and they have no intention to open the BQL API for Python. They couldn't give me a reason why, when I asked but I guess they want to promote their internal BQNT environment.

Pilatus answered 23/4, 2021 at 8:27 Comment(0)
I
0

I use: "from xbbg import blp" This seems to work pretty well.

The syntax is very similar to what one would use in excel e.g.

df = blp.bdh(tickers1, flds=fields, start_date='2017-01-01', end_date='2023-01-25')

There is also: "import blpapi" But I find that less user friendly. You have to initate sessions etc.

Ichneumon answered 26/1, 2023 at 4:3 Comment(1)
That is not related to BQL.Aloisia
Y
0

I've incorporated this functionality into the blp package, which is the successor to pdblp by the same author. Currently, it's accessible exclusively through GitHub:

> pip install git+https://github.com/matthewgilbert/blp.git
from blp import blp

bquery = blp.BlpQuery().start()

bquery.bql(expression="get(px_last()) for(['AAPL US Equity', 'IBM US Equity'])")

Since this is an endpoint without documentation, we haven't yet fully grasped its behavior. So, if anyone comes across any bugs, please feel free to open a GitHub issue.

TIP: For an easy way to create this expression, try Excel's BQL Builder in Advanced View. After previewing the query, you can just "Copy BQL Query String Only."

Yorgos answered 28/8, 2023 at 18:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.